Contract 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 1

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x4bb58ac76841d5a716335266ef512a3f9da57c0a7554422a1325343c97f85189Deploy224524802022-11-16 14:22:3512 days 18 mins ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.0078051330
0x69b762ac2f802edc127492156dba5abca1b10e564bc3b8469ce05e57369e053cDeploy224509402022-11-16 13:30:0112 days 1 hr ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.0078051330
0xd480bb6dd63c50f4d68f5ffe372eeb296bdaa1fec57099e825655f8a090717e3Deploy224505482022-11-16 13:16:2712 days 1 hr ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.0078051330
0xb9fc98060b027a176b3f77c2c5f43804fbb16e1bc39cc4ed34c37baa5092b1eeDeploy224503032022-11-16 13:07:5512 days 1 hr ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.0078047730
0x02a2250d8250a67e77fe43c98840610216eac3320f4041ea56a8e7eab20d10a2Deploy224497352022-11-16 12:48:2412 days 1 hr ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.0078051330
0xb2dd5ddc88b80b772059b605522a949c000ea31e6228cd7baee1112b21771d79Deposit221538212022-11-09 12:12:1519 days 2 hrs ago0xa91c2397677b726e727befdd6bf047d03ee35db8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.001563354 26
0x752e427d1c95d70758ea1586fc6ff717a7ab56135565b862cee2efb56beefdd9Deposit221538022022-11-09 12:11:3419 days 2 hrs ago0xa91c2397677b726e727befdd6bf047d03ee35db8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.001563042 26
0x64976676f13fbb8ba3a6b945243c92b314453f9d656e4a3b92245a5b54020736Set Master Contr...208797872022-10-10 9:32:2749 days 5 hrs ago0x9bd9fe9efa26de971b11cf5afbe307f019ae04f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00136817005 26.41
0x1550f7ae0daf14e610e28e09bf296674fcdd7b3cd3779e9308aecfc9c33bbd22Deposit202168612022-09-24 12:24:4265 days 2 hrs ago0x81a45028a121557e8256598a60541493836a85d7 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.002062736 26
0x61ed9963f146b63db57053e17c69357366b7c9234c0e9bcc815447ec88e771a1Deposit196515422022-09-07 20:15:4781 days 18 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.002007018 26
0xdea60b2170f297109fe7d2de8f3570a69723ac430a49d6cb3ea31bafe06cbe49Deposit196502242022-09-07 19:28:0081 days 19 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00200733 26
0x2135e3fb1c4d367531e3b3a6ae8bbbe48239c42fc597ea1a2cd3d2e0f1345824Deposit196501612022-09-07 19:25:5481 days 19 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00200733 26
0x4143c324bf5e8dfaa0f77f8b536813b1cc7415d4744a5132c4e7ee206caa934bDeposit196500872022-09-07 19:23:1881 days 19 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00200733 26
0x86e4ffd9a075c16cd55852ea6ae5836df42903527093c162c8827154f1cc7ecfDeposit196498522022-09-07 19:15:0881 days 19 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00200733 26
0x17d5c867b240ca2159e0b41502a252eceb2a5dec4fa72e4a81679ba4def07a53Deposit196496532022-09-07 19:07:5181 days 19 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00200733 26
0xcc0a181a1311cb019b9ea6ea30b6094d706da43966d4ec3cd7bb201b1c2e37d2Deposit196491382022-09-07 18:49:3181 days 19 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00200733 26
0x6b4c73109fc19a01167cd300ec29556a89642073a46ca776ffa56e7f3ba8fdceDeposit196489672022-09-07 18:43:2081 days 19 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.002007018 26
0xcceab2b5166626f61685c1b6ba7a941eb817740625651d62fc054073820af606Set Master Contr...196488982022-09-07 18:40:4281 days 20 hrs ago0xd7fced87ba1d52af0a493f4a93de7c00d056d8f8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.001346618 26
0xb7526d9a00e7744d7c1256b44f4b27a40627eadfd49bf2dba3d2b03376543c5dDeposit196433542022-09-07 15:19:0381 days 23 hrs ago0xa91c2397677b726e727befdd6bf047d03ee35db8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.001563354 26
0x7f268e1fdb43b6457b96579619188229ecf79c2d6860a7e1df8c28dad8a0bae0Deposit196433192022-09-07 15:17:4781 days 23 hrs ago0xa91c2397677b726e727befdd6bf047d03ee35db8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.001563042 26
0x3a5bc1f87d8ed86b1af02b5f93cc86117f73227346eeeda87c4b1ea08a6a719aDeposit196414832022-09-07 14:12:2182 days 29 mins ago0xa91c2397677b726e727befdd6bf047d03ee35db8 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.00156273 26
0x3895386e05d9095fdcb99ecb3667f6d2ea35fb98d401e6e1173e7d0bd53aa5f8Deploy195673762022-09-05 15:43:3183 days 22 hrs ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.01951282575
0x3a8159e9c650d75409f5b9369fc5b6215dd1d301fd3f02f7f6fc7baf85aa3cf7Deploy195673312022-09-05 15:41:4283 days 22 hrs ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.01951192575
0x5ae6082fbf534bf71be193c3181ade67f33dc514ce27a5b00ee44ce5151da9a8Deploy195672632022-09-05 15:38:3683 days 23 hrs ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.01951282575
0x96bf18cd082723a193ad674cec4af2fb9e50618b086e6248a43b7abe73ec2341Deploy195672092022-09-05 15:36:4583 days 23 hrs ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750 AVAX0.01951192575
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xbb83be698de69f46a67aca023beb1281eca41566fcd9008bb605c4a353bc666f227659062022-11-24 3:07:564 days 11 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX0.1 AVAX
0xbb83be698de69f46a67aca023beb1281eca41566fcd9008bb605c4a353bc666f227659062022-11-24 3:07:564 days 11 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750.1 AVAX
0xc86ec1a8d51d8a106a3ea5ddbd586a459d15edaff75fb0ed44dd12b3e742f618226416022022-11-21 4:19:427 days 10 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX5 AVAX
0xc86ec1a8d51d8a106a3ea5ddbd586a459d15edaff75fb0ed44dd12b3e742f618226416022022-11-21 4:19:427 days 10 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7755 AVAX
0x13ac7acfecf22a43f79ec2a4a5b63a784afc3e745ea4f98595f3e9e7f3eec746226312912022-11-20 22:27:487 days 16 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX10 AVAX
0x13ac7acfecf22a43f79ec2a4a5b63a784afc3e745ea4f98595f3e9e7f3eec746226312912022-11-20 22:27:487 days 16 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b77510 AVAX
0xccb833bafbc78fcc7bda4e1910a5e196ccbfd20f5c7fd4fbe25dc674b5477003224751092022-11-17 3:27:4711 days 11 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX130 AVAX
0xccb833bafbc78fcc7bda4e1910a5e196ccbfd20f5c7fd4fbe25dc674b5477003224751092022-11-17 3:27:4711 days 11 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775130 AVAX
0xbd3bb42d200ef8338b561ec138a9613138ed2ff198dd35f26a96580391b48300224744512022-11-17 3:04:5311 days 11 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX120 AVAX
0xbd3bb42d200ef8338b561ec138a9613138ed2ff198dd35f26a96580391b48300224744512022-11-17 3:04:5311 days 11 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775120 AVAX
0x4bb58ac76841d5a716335266ef512a3f9da57c0a7554422a1325343c97f85189224524802022-11-16 14:22:3512 days 18 mins ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775  Contract Creation0 AVAX
0x69b762ac2f802edc127492156dba5abca1b10e564bc3b8469ce05e57369e053c224509402022-11-16 13:30:0112 days 1 hr ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775  Contract Creation0 AVAX
0xd480bb6dd63c50f4d68f5ffe372eeb296bdaa1fec57099e825655f8a090717e3224505482022-11-16 13:16:2712 days 1 hr ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775  Contract Creation0 AVAX
0xb9fc98060b027a176b3f77c2c5f43804fbb16e1bc39cc4ed34c37baa5092b1ee224503032022-11-16 13:07:5512 days 1 hr ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775  Contract Creation0 AVAX
0x02a2250d8250a67e77fe43c98840610216eac3320f4041ea56a8e7eab20d10a2224497352022-11-16 12:48:2412 days 1 hr ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775  Contract Creation0 AVAX
0x94ff312bbad9caa73e9079e3b12c4de4906c6d33125d629819caa90895ab126a224480622022-11-16 11:50:4512 days 2 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX0.1 AVAX
0x94ff312bbad9caa73e9079e3b12c4de4906c6d33125d629819caa90895ab126a224480622022-11-16 11:50:4512 days 2 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b7750.1 AVAX
0x441218faf247d43427248eb8adee2463578afbd41e3059e6f505fc920a52fa6e224411012022-11-16 7:44:0612 days 6 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX90 AVAX
0x441218faf247d43427248eb8adee2463578afbd41e3059e6f505fc920a52fa6e224411012022-11-16 7:44:0612 days 6 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b77590 AVAX
0x978df29673da7285e1c1751c889f0fbc1c977459aa59db4bfbf676c44c469c36224405342022-11-16 7:23:5112 days 7 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX100 AVAX
0x978df29673da7285e1c1751c889f0fbc1c977459aa59db4bfbf676c44c469c36224405342022-11-16 7:23:5112 days 7 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775100 AVAX
0x73d4b62bbf387597d8d714072e2a7f018926671fd5ce0bb108340fd8e1469541224397412022-11-16 6:55:4212 days 7 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX110 AVAX
0x73d4b62bbf387597d8d714072e2a7f018926671fd5ce0bb108340fd8e1469541224397412022-11-16 6:55:4212 days 7 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775110 AVAX
0x7796026efc9633579ec10eab45d36ad52b001bfd6c8e94c10b58be1dd32e290a224383782022-11-16 6:07:3012 days 8 hrs ago 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775 Wrapped AVAX100 AVAX
0x7796026efc9633579ec10eab45d36ad52b001bfd6c8e94c10b58be1dd32e290a224383782022-11-16 6:07:3012 days 8 hrs ago 0xc337467f7266fa6677d8459d4bc531d056348da8 0x0b1f9c2211f77ec3fa2719671c5646cf6e59b775100 AVAX
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
DegenBox

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : DegenBox.sol
// SPDX-License-Identifier: UNLICENSED
// The BentoBox

//  ▄▄▄▄· ▄▄▄ . ▐ ▄ ▄▄▄▄▄      ▄▄▄▄·       ▐▄• ▄
//  ▐█ ▀█▪▀▄.▀·█▌▐█•██  ▪     ▐█ ▀█▪▪      █▌█▌▪
//  ▐█▀▀█▄▐▀▀▪▄▐█▐▐▌ ▐█.▪ ▄█▀▄ ▐█▀▀█▄ ▄█▀▄  ·██·
//  ██▄▪▐█▐█▄▄▌██▐█▌ ▐█▌·▐█▌.▐▌██▄▪▐█▐█▌.▐▌▪▐█·█▌
//  ·▀▀▀▀  ▀▀▀ ▀▀ █▪ ▀▀▀  ▀█▄▀▪·▀▀▀▀  ▀█▄▀▪•▀▀ ▀▀

// This contract stores funds, handles their transfers, supports flash loans and strategies.

// Copyright (c) 2021 BoringCrypto - All rights reserved
// Twitter: @Boring_Crypto

// Special thanks to Keno for all his hard work and support

// Version 22-Mar-2021

pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

// solhint-disable avoid-low-level-calls
// solhint-disable not-rely-on-time
// solhint-disable no-inline-assembly

// File @boringcrypto/boring-solidity/contracts/interfaces/[email protected]
// License-Identifier: MIT

interface IERC20 {
    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

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

    /// @notice EIP 2612
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

// File contracts/interfaces/IFlashLoan.sol
// License-Identifier: MIT

interface IFlashBorrower {
    /// @notice The flashloan callback. `amount` + `fee` needs to repayed to msg.sender before this call returns.
    /// @param sender The address of the invoker of this flashloan.
    /// @param token The address of the token that is loaned.
    /// @param amount of the `token` that is loaned.
    /// @param fee The fee that needs to be paid on top for this loan. Needs to be the same as `token`.
    /// @param data Additional data that was passed to the flashloan function.
    function onFlashLoan(
        address sender,
        IERC20 token,
        uint256 amount,
        uint256 fee,
        bytes calldata data
    ) external;
}

interface IBatchFlashBorrower {
    /// @notice The callback for batched flashloans. Every amount + fee needs to repayed to msg.sender before this call returns.
    /// @param sender The address of the invoker of this flashloan.
    /// @param tokens Array of addresses for ERC-20 tokens that is loaned.
    /// @param amounts A one-to-one map to `tokens` that is loaned.
    /// @param fees A one-to-one map to `tokens` that needs to be paid on top for each loan. Needs to be the same token.
    /// @param data Additional data that was passed to the flashloan function.
    function onBatchFlashLoan(
        address sender,
        IERC20[] calldata tokens,
        uint256[] calldata amounts,
        uint256[] calldata fees,
        bytes calldata data
    ) external;
}

// File contracts/interfaces/IWETH.sol
// License-Identifier: MIT

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256) external;
}

// File contracts/interfaces/IStrategy.sol
// License-Identifier: MIT

interface IStrategy {
    /// @notice Send the assets to the Strategy and call skim to invest them.
    /// @param amount The amount of tokens to invest.
    function skim(uint256 amount) external;

    /// @notice Harvest any profits made converted to the asset and pass them to the caller.
    /// @param balance The amount of tokens the caller thinks it has invested.
    /// @param sender The address of the initiator of this transaction. Can be used for reimbursements, etc.
    /// @return amountAdded The delta (+profit or -loss) that occured in contrast to `balance`.
    function harvest(uint256 balance, address sender) external returns (int256 amountAdded);

    /// @notice Withdraw assets. The returned amount can differ from the requested amount due to rounding.
    /// @dev The `actualAmount` should be very close to the amount.
    /// The difference should NOT be used to report a loss. That's what harvest is for.
    /// @param amount The requested amount the caller wants to withdraw.
    /// @return actualAmount The real amount that is withdrawn.
    function withdraw(uint256 amount) external returns (uint256 actualAmount);

    /// @notice Withdraw all assets in the safest way possible. This shouldn't fail.
    /// @param balance The amount of tokens the caller thinks it has invested.
    /// @return amountAdded The delta (+profit or -loss) that occured in contrast to `balance`.
    function exit(uint256 balance) external returns (int256 amountAdded);
}

// File @boringcrypto/boring-solidity/contracts/libraries/[email protected]
// License-Identifier: MIT

library BoringERC20 {
    bytes4 private constant SIG_SYMBOL = 0x95d89b41; // symbol()
    bytes4 private constant SIG_NAME = 0x06fdde03; // name()
    bytes4 private constant SIG_DECIMALS = 0x313ce567; // decimals()
    bytes4 private constant SIG_TRANSFER = 0xa9059cbb; // transfer(address,uint256)
    bytes4 private constant SIG_TRANSFER_FROM = 0x23b872dd; // transferFrom(address,address,uint256)

    /// @notice Provides a safe ERC20.transfer version for different ERC-20 implementations.
    /// Reverts on a failed transfer.
    /// @param token The address of the ERC-20 token.
    /// @param to Transfer tokens to.
    /// @param amount The token amount.
    function safeTransfer(
        IERC20 token,
        address to,
        uint256 amount
    ) internal {
        (bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(SIG_TRANSFER, to, amount));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "BoringERC20: Transfer failed");
    }

    /// @notice Provides a safe ERC20.transferFrom version for different ERC-20 implementations.
    /// Reverts on a failed transfer.
    /// @param token The address of the ERC-20 token.
    /// @param from Transfer tokens from.
    /// @param to Transfer tokens to.
    /// @param amount The token amount.
    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        (bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(SIG_TRANSFER_FROM, from, to, amount));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "BoringERC20: TransferFrom failed");
    }
}

// File @boringcrypto/boring-solidity/contracts/libraries/[email protected]
// License-Identifier: MIT

/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library BoringMath {
    function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
        require((c = a + b) >= b, "BoringMath: Add Overflow");
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
        require((c = a - b) <= a, "BoringMath: Underflow");
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow");
    }

    function to128(uint256 a) internal pure returns (uint128 c) {
        require(a <= uint128(-1), "BoringMath: uint128 Overflow");
        c = uint128(a);
    }

    function to64(uint256 a) internal pure returns (uint64 c) {
        require(a <= uint64(-1), "BoringMath: uint64 Overflow");
        c = uint64(a);
    }

    function to32(uint256 a) internal pure returns (uint32 c) {
        require(a <= uint32(-1), "BoringMath: uint32 Overflow");
        c = uint32(a);
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint128.
library BoringMath128 {
    function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
        require((c = a + b) >= b, "BoringMath: Add Overflow");
    }

    function sub(uint128 a, uint128 b) internal pure returns (uint128 c) {
        require((c = a - b) <= a, "BoringMath: Underflow");
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint64.
library BoringMath64 {
    function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
        require((c = a + b) >= b, "BoringMath: Add Overflow");
    }

    function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {
        require((c = a - b) <= a, "BoringMath: Underflow");
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32.
library BoringMath32 {
    function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
        require((c = a + b) >= b, "BoringMath: Add Overflow");
    }

    function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {
        require((c = a - b) <= a, "BoringMath: Underflow");
    }
}

// File @boringcrypto/boring-solidity/contracts/libraries/[email protected]
// License-Identifier: MIT

struct Rebase {
    uint128 elastic;
    uint128 base;
}

/// @notice A rebasing library using overflow-/underflow-safe math.
library RebaseLibrary {
    using BoringMath for uint256;
    using BoringMath128 for uint128;

    /// @notice Calculates the base value in relationship to `elastic` and `total`.
    function toBase(
        Rebase memory total,
        uint256 elastic,
        bool roundUp
    ) internal pure returns (uint256 base) {
        if (total.elastic == 0) {
            base = elastic;
        } else {
            base = elastic.mul(total.base) / total.elastic;
            if (roundUp && base.mul(total.elastic) / total.base < elastic) {
                base = base.add(1);
            }
        }
    }

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

    /// @notice Add `elastic` to `total` and doubles `total.base`.
    /// @return (Rebase) The new total.
    /// @return base in relationship to `elastic`.
    function add(
        Rebase memory total,
        uint256 elastic,
        bool roundUp
    ) internal pure returns (Rebase memory, uint256 base) {
        base = toBase(total, elastic, roundUp);
        total.elastic = total.elastic.add(elastic.to128());
        total.base = total.base.add(base.to128());
        return (total, base);
    }

    /// @notice Sub `base` from `total` and update `total.elastic`.
    /// @return (Rebase) The new total.
    /// @return elastic in relationship to `base`.
    function sub(
        Rebase memory total,
        uint256 base,
        bool roundUp
    ) internal pure returns (Rebase memory, uint256 elastic) {
        elastic = toElastic(total, base, roundUp);
        total.elastic = total.elastic.sub(elastic.to128());
        total.base = total.base.sub(base.to128());
        return (total, elastic);
    }

    /// @notice Add `elastic` and `base` to `total`.
    function add(
        Rebase memory total,
        uint256 elastic,
        uint256 base
    ) internal pure returns (Rebase memory) {
        total.elastic = total.elastic.add(elastic.to128());
        total.base = total.base.add(base.to128());
        return total;
    }

    /// @notice Subtract `elastic` and `base` to `total`.
    function sub(
        Rebase memory total,
        uint256 elastic,
        uint256 base
    ) internal pure returns (Rebase memory) {
        total.elastic = total.elastic.sub(elastic.to128());
        total.base = total.base.sub(base.to128());
        return total;
    }

    /// @notice Add `elastic` to `total` and update storage.
    /// @return newElastic Returns updated `elastic`.
    function addElastic(Rebase storage total, uint256 elastic) internal returns (uint256 newElastic) {
        newElastic = total.elastic = total.elastic.add(elastic.to128());
    }

    /// @notice Subtract `elastic` from `total` and update storage.
    /// @return newElastic Returns updated `elastic`.
    function subElastic(Rebase storage total, uint256 elastic) internal returns (uint256 newElastic) {
        newElastic = total.elastic = total.elastic.sub(elastic.to128());
    }
}

// File @boringcrypto/boring-solidity/contracts/[email protected]
// License-Identifier: MIT

// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol + Claimable.sol
// Edited by BoringCrypto

contract BoringOwnableData {
    address public owner;
    address public pendingOwner;
}

contract BoringOwnable is BoringOwnableData {
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @notice `owner` defaults to msg.sender on construction.
    constructor() public {
        owner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
    }

    /// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner.
    /// Can only be invoked by the current `owner`.
    /// @param newOwner Address of the new owner.
    /// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.
    /// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise.
    function transferOwnership(
        address newOwner,
        bool direct,
        bool renounce
    ) public onlyOwner {
        if (direct) {
            // Checks
            require(newOwner != address(0) || renounce, "Ownable: zero address");

            // Effects
            emit OwnershipTransferred(owner, newOwner);
            owner = newOwner;
            pendingOwner = address(0);
        } else {
            // Effects
            pendingOwner = newOwner;
        }
    }

    /// @notice Needs to be called by `pendingOwner` to claim ownership.
    function claimOwnership() public {
        address _pendingOwner = pendingOwner;

        // Checks
        require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");

        // Effects
        emit OwnershipTransferred(owner, _pendingOwner);
        owner = _pendingOwner;
        pendingOwner = address(0);
    }

    /// @notice Only allows the `owner` to execute the function.
    modifier onlyOwner() {
        require(msg.sender == owner, "Ownable: caller is not the owner");
        _;
    }
}

// File @boringcrypto/boring-solidity/contracts/interfaces/[email protected]
// License-Identifier: MIT

interface IMasterContract {
    /// @notice Init function that gets called from `BoringFactory.deploy`.
    /// Also kown as the constructor for cloned contracts.
    /// Any ETH send to `BoringFactory.deploy` ends up here.
    /// @param data Can be abi encoded arguments or anything else.
    function init(bytes calldata data) external payable;
}

// File @boringcrypto/boring-solidity/contracts/[email protected]
// License-Identifier: MIT

contract BoringFactory {
    event LogDeploy(address indexed masterContract, bytes data, address indexed cloneAddress);

    /// @notice Mapping from clone contracts to their masterContract.
    mapping(address => address) public masterContractOf;

    /// @notice List of deployed pools.
    address[] public pools;

    /// @notice Deploys a given master Contract as a clone.
    /// Any ETH transferred with this call is forwarded to the new clone.
    /// Emits `LogDeploy`.
    /// @param masterContract The address of the contract to clone.
    /// @param data Additional abi encoded calldata that is passed to the new clone via `IMasterContract.init`.
    /// @param useCreate2 Creates the clone by using the CREATE2 opcode, in this case `data` will be used as salt.
    /// @return cloneAddress Address of the created clone contract.
    function deploy(
        address masterContract,
        bytes calldata data,
        bool useCreate2
    ) public payable returns (address cloneAddress) {
        require(masterContract != address(0), "BoringFactory: No masterContract");
        bytes20 targetBytes = bytes20(masterContract); // Takes the first 20 bytes of the masterContract's address

        if (useCreate2) {
            // each masterContract has different code already. So clones are distinguished by their data only.
            bytes32 salt = keccak256(data);

            // Creates clone, more info here: https://blog.openzeppelin.com/deep-dive-into-the-minimal-proxy-contract/
            assembly {
                let clone := mload(0x40)
                mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
                mstore(add(clone, 0x14), targetBytes)
                mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
                cloneAddress := create2(0, clone, 0x37, salt)
            }
        } else {
            assembly {
                let clone := mload(0x40)
                mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
                mstore(add(clone, 0x14), targetBytes)
                mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
                cloneAddress := create(0, clone, 0x37)
            }
        }
        masterContractOf[cloneAddress] = masterContract;
        pools.push(cloneAddress);

        IMasterContract(cloneAddress).init{value: msg.value}(data);

        emit LogDeploy(masterContract, data, cloneAddress);
    }

    /// @notice Returns all deployed pools.
    /// @return Addresses of deployed pools.
    function getAllPools() public view returns (address[] memory) {
         return pools;
     }
}

// File contracts/MasterContractManager.sol
// License-Identifier: UNLICENSED

contract MasterContractManager is BoringOwnable, BoringFactory {
    event LogWhiteListMasterContract(address indexed masterContract, bool approved);
    event LogSetMasterContractApproval(address indexed masterContract, address indexed user, bool approved);
    event LogRegisterProtocol(address indexed protocol);

    /// @notice masterContract to user to approval state
    mapping(address => mapping(address => bool)) public masterContractApproved;
    /// @notice masterContract to whitelisted state for approval without signed message
    mapping(address => bool) public whitelistedMasterContracts;
    /// @notice user nonces for masterContract approvals
    mapping(address => uint256) public nonces;

    bytes32 private constant DOMAIN_SEPARATOR_SIGNATURE_HASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
    // See https://eips.ethereum.org/EIPS/eip-191
    string private constant EIP191_PREFIX_FOR_EIP712_STRUCTURED_DATA = "\x19\x01";
    bytes32 private constant APPROVAL_SIGNATURE_HASH =
        keccak256("SetMasterContractApproval(string warning,address user,address masterContract,bool approved,uint256 nonce)");

    // solhint-disable-next-line var-name-mixedcase
    bytes32 private immutable _DOMAIN_SEPARATOR;
    // solhint-disable-next-line var-name-mixedcase
    uint256 private immutable DOMAIN_SEPARATOR_CHAIN_ID;

    constructor() public {
        uint256 chainId;
        assembly {
            chainId := chainid()
        }
        _DOMAIN_SEPARATOR = _calculateDomainSeparator(DOMAIN_SEPARATOR_CHAIN_ID = chainId);
    }

    function _calculateDomainSeparator(uint256 chainId) private view returns (bytes32) {
        return keccak256(abi.encode(DOMAIN_SEPARATOR_SIGNATURE_HASH, keccak256("BentoBox V1"), chainId, address(this)));
    }

    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() public view returns (bytes32) {
        uint256 chainId;
        assembly {
            chainId := chainid()
        }
        return chainId == DOMAIN_SEPARATOR_CHAIN_ID ? _DOMAIN_SEPARATOR : _calculateDomainSeparator(chainId);
    }

    /// @notice Other contracts need to register with this master contract so that users can approve them for the BentoBox.
    function registerProtocol() public {
        masterContractOf[msg.sender] = msg.sender;
        emit LogRegisterProtocol(msg.sender);
    }

    /// @notice Enables or disables a contract for approval without signed message.
    function whitelistMasterContract(address masterContract, bool approved) public onlyOwner {
        // Checks
        require(masterContract != address(0), "MasterCMgr: Cannot approve 0");

        // Effects
        whitelistedMasterContracts[masterContract] = approved;
        emit LogWhiteListMasterContract(masterContract, approved);
    }

    /// @notice Approves or revokes a `masterContract` access to `user` funds.
    /// @param user The address of the user that approves or revokes access.
    /// @param masterContract The address who gains or loses access.
    /// @param approved If True approves access. If False revokes access.
    /// @param v Part of the signature. (See EIP-191)
    /// @param r Part of the signature. (See EIP-191)
    /// @param s Part of the signature. (See EIP-191)
    // F4 - Check behaviour for all function arguments when wrong or extreme
    // F4: Don't allow masterContract 0 to be approved. Unknown contracts will have a masterContract of 0.
    // F4: User can't be 0 for signed approvals because the recoveredAddress will be 0 if ecrecover fails
    function setMasterContractApproval(
        address user,
        address masterContract,
        bool approved,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public {
        // Checks
        require(masterContract != address(0), "MasterCMgr: masterC not set"); // Important for security

        // If no signature is provided, the fallback is executed
        if (r == 0 && s == 0 && v == 0) {
            require(user == msg.sender, "MasterCMgr: user not sender");
            require(masterContractOf[user] == address(0), "MasterCMgr: user is clone");
            require(whitelistedMasterContracts[masterContract], "MasterCMgr: not whitelisted");
        } else {
            // Important for security - any address without masterContract has address(0) as masterContract
            // So approving address(0) would approve every address, leading to full loss of funds
            // Also, ecrecover returns address(0) on failure. So we check this:
            require(user != address(0), "MasterCMgr: User cannot be 0");

            // C10 - Protect signatures against replay, use nonce and chainId (SWC-121)
            // C10: nonce + chainId are used to prevent replays
            // C11 - All signatures strictly EIP-712 (SWC-117 SWC-122)
            // C11: signature is EIP-712 compliant
            // C12 - abi.encodePacked can't contain variable length user input (SWC-133)
            // C12: abi.encodePacked has fixed length parameters
            bytes32 digest =
                keccak256(
                    abi.encodePacked(
                        EIP191_PREFIX_FOR_EIP712_STRUCTURED_DATA,
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                APPROVAL_SIGNATURE_HASH,
                                approved
                                    ? keccak256("Give FULL access to funds in (and approved to) BentoBox?")
                                    : keccak256("Revoke access to BentoBox?"),
                                user,
                                masterContract,
                                approved,
                                nonces[user]++
                            )
                        )
                    )
                );
            address recoveredAddress = ecrecover(digest, v, r, s);
            require(recoveredAddress == user, "MasterCMgr: Invalid Signature");
        }

        // Effects
        masterContractApproved[masterContract][user] = approved;
        emit LogSetMasterContractApproval(masterContract, user, approved);
    }
}

// File @boringcrypto/boring-solidity/contracts/[email protected]
// License-Identifier: MIT

contract BaseBoringBatchable {
    /// @dev Helper function to extract a useful revert message from a failed call.
    /// If the returned data is malformed or not correctly abi encoded then this call can fail itself.
    function _getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {
        // If the _res length is less than 68, then the transaction failed silently (without a revert message)
        if (_returnData.length < 68) return "Transaction reverted silently";

        assembly {
            // Slice the sighash.
            _returnData := add(_returnData, 0x04)
        }
        return abi.decode(_returnData, (string)); // All that remains is the revert string
    }

    /// @notice Allows batched call to self (this contract).
    /// @param calls An array of inputs for each call.
    /// @param revertOnFail If True then reverts after a failed call and stops doing further calls.
    /// @return successes An array indicating the success of a call, mapped one-to-one to `calls`.
    /// @return results An array with the returned data of each function call, mapped one-to-one to `calls`.
    // F1: External is ok here because this is the batch function, adding it to a batch makes no sense
    // F2: Calls in the batch may be payable, delegatecall operates in the same context, so each call in the batch has access to msg.value
    // C3: The length of the loop is fully under user control, so can't be exploited
    // C7: Delegatecall is only used on the same contract, so it's safe
    function batch(bytes[] calldata calls, bool revertOnFail) external payable returns (bool[] memory successes, bytes[] memory results) {
        successes = new bool[](calls.length);
        results = new bytes[](calls.length);
        for (uint256 i = 0; i < calls.length; i++) {
            (bool success, bytes memory result) = address(this).delegatecall(calls[i]);
            require(success || !revertOnFail, _getRevertMsg(result));
            successes[i] = success;
            results[i] = result;
        }
    }
}

contract BoringBatchable is BaseBoringBatchable {
    /// @notice Call wrapper that performs `ERC20.permit` on `token`.
    /// Lookup `IERC20.permit`.
    // F6: Parameters can be used front-run the permit and the user's permit will fail (due to nonce or other revert)
    //     if part of a batch this could be used to grief once as the second call would not need the permit
    function permitToken(
        IERC20 token,
        address from,
        address to,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public {
        token.permit(from, to, amount, deadline, v, r, s);
    }
}

// File contracts/DegenBox.sol
// License-Identifier: UNLICENSED

/// @title DegenBox
/// @author BoringCrypto, Keno
/// @notice The BentoBox is a vault for tokens. The stored tokens can be flash loaned and used in strategies.
/// Yield from this will go to the token depositors.
/// Rebasing tokens ARE NOT supported and WILL cause loss of funds.
/// Any funds transfered directly onto the BentoBox will be lost, use the deposit function instead.
contract DegenBox is MasterContractManager, BoringBatchable {
    using BoringMath for uint256;
    using BoringMath128 for uint128;
    using BoringERC20 for IERC20;
    using RebaseLibrary for Rebase;

    // ************** //
    // *** EVENTS *** //
    // ************** //

    event LogDeposit(IERC20 indexed token, address indexed from, address indexed to, uint256 amount, uint256 share);
    event LogWithdraw(IERC20 indexed token, address indexed from, address indexed to, uint256 amount, uint256 share);
    event LogTransfer(IERC20 indexed token, address indexed from, address indexed to, uint256 share);

    event LogFlashLoan(address indexed borrower, IERC20 indexed token, uint256 amount, uint256 feeAmount, address indexed receiver);

    event LogStrategyTargetPercentage(IERC20 indexed token, uint256 targetPercentage);
    event LogStrategyQueued(IERC20 indexed token, IStrategy indexed strategy);
    event LogStrategySet(IERC20 indexed token, IStrategy indexed strategy);
    event LogStrategyInvest(IERC20 indexed token, uint256 amount);
    event LogStrategyDivest(IERC20 indexed token, uint256 amount);
    event LogStrategyProfit(IERC20 indexed token, uint256 amount);
    event LogStrategyLoss(IERC20 indexed token, uint256 amount);

    // *************** //
    // *** STRUCTS *** //
    // *************** //

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

    // ******************************** //
    // *** CONSTANTS AND IMMUTABLES *** //
    // ******************************** //

    // V2 - Can they be private?
    // V2: Private to save gas, to verify it's correct, check the constructor arguments
    IERC20 private immutable wethToken;

    IERC20 private constant USE_ETHEREUM = IERC20(0);
    uint256 private constant FLASH_LOAN_FEE = 50; // 0.05%
    uint256 private constant FLASH_LOAN_FEE_PRECISION = 1e5;
    uint256 private constant STRATEGY_DELAY = 3 days;
    uint256 private constant MAX_TARGET_PERCENTAGE = 95; // 95%
    uint256 private constant MINIMUM_SHARE_BALANCE = 1000; // To prevent the ratio going off

    // ***************** //
    // *** VARIABLES *** //
    // ***************** //

    // Balance per token per address/contract in shares
    mapping(IERC20 => mapping(address => uint256)) public balanceOf;

    // Rebase from amount to share
    mapping(IERC20 => Rebase) public totals;

    mapping(IERC20 => IStrategy) public strategy;
    mapping(IERC20 => IStrategy) public pendingStrategy;
    mapping(IERC20 => StrategyData) public strategyData;

    // ******************* //
    // *** CONSTRUCTOR *** //
    // ******************* //

    constructor(IERC20 wethToken_) public {
        wethToken = wethToken_;
    }

    // ***************** //
    // *** MODIFIERS *** //
    // ***************** //

    /// Modifier to check if the msg.sender is allowed to use funds belonging to the 'from' address.
    /// If 'from' is msg.sender, it's allowed.
    /// If 'from' is the BentoBox itself, it's allowed. Any ETH, token balances (above the known balances) or BentoBox balances
    /// can be taken by anyone.
    /// This is to enable skimming, not just for deposits, but also for withdrawals or transfers, enabling better composability.
    /// If 'from' is a clone of a masterContract AND the 'from' address has approved that masterContract, it's allowed.
    modifier allowed(address from) {
        if (from != msg.sender && from != address(this)) {
            // From is sender or you are skimming
            address masterContract = masterContractOf[msg.sender];
            require(masterContract != address(0), "BentoBox: no masterContract");
            require(masterContractApproved[masterContract][from], "BentoBox: Transfer not approved");
        }
        _;
    }

    // ************************** //
    // *** INTERNAL FUNCTIONS *** //
    // ************************** //

    /// @dev Returns the total balance of `token` this contracts holds,
    /// plus the total amount this contract thinks the strategy holds.
    function _tokenBalanceOf(IERC20 token) internal view returns (uint256 amount) {
        amount = token.balanceOf(address(this)).add(strategyData[token].balance);
    }

    // ************************ //
    // *** PUBLIC FUNCTIONS *** //
    // ************************ //

    /// @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(
        IERC20 token,
        uint256 amount,
        bool roundUp
    ) external view returns (uint256 share) {
        share = totals[token].toBase(amount, roundUp);
    }

    /// @dev Helper function 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(
        IERC20 token,
        uint256 share,
        bool roundUp
    ) external view returns (uint256 amount) {
        amount = totals[token].toElastic(share, roundUp);
    }

    /// @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 repesented in shares.
    function deposit(
        IERC20 token_,
        address from,
        address to,
        uint256 amount,
        uint256 share
    ) public payable allowed(from) returns (uint256 amountOut, uint256 shareOut) {
        // Checks
        require(to != address(0), "BentoBox: to not set"); // To avoid a bad UI from burning funds

        // Effects
        IERC20 token = token_ == USE_ETHEREUM ? wethToken : token_;
        Rebase memory total = totals[token];

        // If a new token gets added, the tokenSupply call checks that this is a deployed contract. Needed for security.
        require(total.elastic != 0 || token.totalSupply() > 0, "BentoBox: No tokens");
        if (share == 0) {
            // value of the share may be lower than the amount due to rounding, that's ok
            share = total.toBase(amount, false);
            // Any deposit should lead to at least the minimum share balance, otherwise it's ignored (no amount taken)
            if (total.base.add(share.to128()) < MINIMUM_SHARE_BALANCE) {
                return (0, 0);
            }
        } else {
            // amount may be lower than the value of share due to rounding, in that case, add 1 to amount (Always round up)
            amount = total.toElastic(share, true);
        }

        // In case of skimming, check that only the skimmable amount is taken.
        // For ETH, the full balance is available, so no need to check.
        // During flashloans the _tokenBalanceOf is lower than 'reality', so skimming deposits will mostly fail during a flashloan.
        require(
            from != address(this) || token_ == USE_ETHEREUM || amount <= _tokenBalanceOf(token).sub(total.elastic),
            "BentoBox: Skim too much"
        );

        balanceOf[token][to] = balanceOf[token][to].add(share);
        total.base = total.base.add(share.to128());
        total.elastic = total.elastic.add(amount.to128());
        totals[token] = total;

        // Interactions
        // During the first deposit, we check that this token is 'real'
        if (token_ == USE_ETHEREUM) {
            // X2 - If there is an error, could it cause a DoS. Like balanceOf causing revert. (SWC-113)
            // X2: If the WETH implementation is faulty or malicious, it will block adding ETH (but we know the WETH implementation)
            IWETH(address(wethToken)).deposit{value: amount}();
        } else if (from != address(this)) {
            // X2 - If there is an error, could it cause a DoS. Like balanceOf causing revert. (SWC-113)
            // X2: If the token implementation is faulty or malicious, it may block adding tokens. Good.
            token.safeTransferFrom(from, address(this), amount);
        }
        emit LogDeposit(token, from, to, amount, share);
        amountOut = amount;
        shareOut = share;
    }

    /// @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(
        IERC20 token_,
        address from,
        address to,
        uint256 amount,
        uint256 share
    ) public allowed(from) returns (uint256 amountOut, uint256 shareOut) {
        // Checks
        require(to != address(0), "BentoBox: to not set"); // To avoid a bad UI from burning funds

        // Effects
        IERC20 token = token_ == USE_ETHEREUM ? wethToken : token_;
        Rebase memory total = totals[token];
        if (share == 0) {
            // value of the share paid could be lower than the amount paid due to rounding, in that case, add a share (Always round up)
            share = total.toBase(amount, true);
        } else {
            // amount may be lower than the value of share due to rounding, that's ok
            amount = total.toElastic(share, false);
        }

        balanceOf[token][from] = balanceOf[token][from].sub(share);
        total.elastic = total.elastic.sub(amount.to128());
        total.base = total.base.sub(share.to128());
        // There have to be at least 1000 shares left to prevent reseting the share/amount ratio (unless it's fully emptied)
        require(total.base >= MINIMUM_SHARE_BALANCE || total.base == 0, "BentoBox: cannot empty");
        totals[token] = total;

        // Interactions
        if (token_ == USE_ETHEREUM) {
            // X2, X3: A revert or big gas usage in the WETH contract could block withdrawals, but WETH9 is fine.
            IWETH(address(wethToken)).withdraw(amount);
            // X2, X3: A revert or big gas usage could block, however, the to address is under control of the caller.
            (bool success, ) = to.call{value: amount}("");
            require(success, "BentoBox: ETH transfer failed");
        } else {
            // X2, X3: A malicious token could block withdrawal of just THAT token.
            //         masterContracts may want to take care not to rely on withdraw always succeeding.
            token.safeTransfer(to, amount);
        }
        emit LogWithdraw(token, from, to, amount, share);
        amountOut = amount;
        shareOut = share;
    }

    /// @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.
    // Clones of master contracts can transfer from any account that has approved them
    // F3 - Can it be combined with another similar function?
    // F3: This isn't combined with transferMultiple for gas optimization
    function transfer(
        IERC20 token,
        address from,
        address to,
        uint256 share
    ) public allowed(from) {
        // Checks
        require(to != address(0), "BentoBox: to not set"); // To avoid a bad UI from burning funds

        // Effects
        balanceOf[token][from] = balanceOf[token][from].sub(share);
        balanceOf[token][to] = balanceOf[token][to].add(share);

        emit LogTransfer(token, from, to, share);
    }

    /// @notice Transfer shares from a user account to multiple other ones.
    /// @param token The ERC-20 token to transfer.
    /// @param from which user to pull the tokens.
    /// @param tos The receivers of the tokens.
    /// @param shares The amount of `token` in shares for each receiver in `tos`.
    // F3 - Can it be combined with another similar function?
    // F3: This isn't combined with transfer for gas optimization
    function transferMultiple(
        IERC20 token,
        address from,
        address[] calldata tos,
        uint256[] calldata shares
    ) public allowed(from) {
        // Checks
        require(tos[0] != address(0), "BentoBox: to[0] not set"); // To avoid a bad UI from burning funds

        // Effects
        uint256 totalAmount;
        uint256 len = tos.length;
        for (uint256 i = 0; i < len; i++) {
            address to = tos[i];
            balanceOf[token][to] = balanceOf[token][to].add(shares[i]);
            totalAmount = totalAmount.add(shares[i]);
            emit LogTransfer(token, from, to, shares[i]);
        }
        balanceOf[token][from] = balanceOf[token][from].sub(totalAmount);
    }

    /// @notice Flashloan ability.
    /// @param borrower The address of the contract that implements and conforms to `IFlashBorrower` and handles the flashloan.
    /// @param receiver Address of the token receiver.
    /// @param token The address of the token to receive.
    /// @param amount of the tokens to receive.
    /// @param data The calldata to pass to the `borrower` contract.
    // F5 - Checks-Effects-Interactions pattern followed? (SWC-107)
    // F5: Not possible to follow this here, reentrancy has been reviewed
    // F6 - Check for front-running possibilities, such as the approve function (SWC-114)
    // F6: Slight grieving possible by withdrawing an amount before someone tries to flashloan close to the full amount.
    function flashLoan(
        IFlashBorrower borrower,
        address receiver,
        IERC20 token,
        uint256 amount,
        bytes calldata data
    ) public {
        uint256 fee = amount.mul(FLASH_LOAN_FEE) / FLASH_LOAN_FEE_PRECISION;
        token.safeTransfer(receiver, amount);

        borrower.onFlashLoan(msg.sender, token, amount, fee, data);

        require(_tokenBalanceOf(token) >= totals[token].addElastic(fee.to128()), "BentoBox: Wrong amount");
        emit LogFlashLoan(address(borrower), token, amount, fee, receiver);
    }

    /// @notice Support for batched flashloans. Useful to request multiple different `tokens` in a single transaction.
    /// @param borrower The address of the contract that implements and conforms to `IBatchFlashBorrower` and handles the flashloan.
    /// @param receivers An array of the token receivers. A one-to-one mapping with `tokens` and `amounts`.
    /// @param tokens The addresses of the tokens.
    /// @param amounts of the tokens for each receiver.
    /// @param data The calldata to pass to the `borrower` contract.
    // F5 - Checks-Effects-Interactions pattern followed? (SWC-107)
    // F5: Not possible to follow this here, reentrancy has been reviewed
    // F6 - Check for front-running possibilities, such as the approve function (SWC-114)
    // F6: Slight grieving possible by withdrawing an amount before someone tries to flashloan close to the full amount.
    function batchFlashLoan(
        IBatchFlashBorrower borrower,
        address[] calldata receivers,
        IERC20[] calldata tokens,
        uint256[] calldata amounts,
        bytes calldata data
    ) public {
        uint256[] memory fees = new uint256[](tokens.length);

        uint256 len = tokens.length;
        for (uint256 i = 0; i < len; i++) {
            uint256 amount = amounts[i];
            fees[i] = amount.mul(FLASH_LOAN_FEE) / FLASH_LOAN_FEE_PRECISION;

            tokens[i].safeTransfer(receivers[i], amounts[i]);
        }

        borrower.onBatchFlashLoan(msg.sender, tokens, amounts, fees, data);

        for (uint256 i = 0; i < len; i++) {
            IERC20 token = tokens[i];
            require(_tokenBalanceOf(token) >= totals[token].addElastic(fees[i].to128()), "BentoBox: Wrong amount");
            emit LogFlashLoan(address(borrower), token, amounts[i], fees[i], receivers[i]);
        }
    }

    /// @notice Sets the target percentage of the strategy for `token`.
    /// @dev Only the owner of this contract is allowed to change this.
    /// @param token The address of the token that maps to a strategy to change.
    /// @param targetPercentage_ The new target in percent. Must be lesser or equal to `MAX_TARGET_PERCENTAGE`.
    function setStrategyTargetPercentage(IERC20 token, uint64 targetPercentage_) public onlyOwner {
        // Checks
        require(targetPercentage_ <= MAX_TARGET_PERCENTAGE, "StrategyManager: Target too high");

        // Effects
        strategyData[token].targetPercentage = targetPercentage_;
        emit LogStrategyTargetPercentage(token, targetPercentage_);
    }

    /// @notice Sets the contract address of a new strategy that conforms to `IStrategy` for `token`.
    /// Must be called twice with the same arguments.
    /// A new strategy becomes pending first and can be activated once `STRATEGY_DELAY` is over.
    /// @dev Only the owner of this contract is allowed to change this.
    /// @param token The address of the token that maps to a strategy to change.
    /// @param newStrategy The address of the contract that conforms to `IStrategy`.
    // F5 - Checks-Effects-Interactions pattern followed? (SWC-107)
    // F5: Total amount is updated AFTER interaction. But strategy is under our control.
    // C4 - Use block.timestamp only for long intervals (SWC-116)
    // C4: block.timestamp is used for a period of 2 weeks, which is long enough
    function setStrategy(IERC20 token, IStrategy newStrategy) public onlyOwner {
        StrategyData memory data = strategyData[token];
        IStrategy pending = pendingStrategy[token];
        if (data.strategyStartDate == 0 || pending != newStrategy) {
            pendingStrategy[token] = newStrategy;
            // C1 - All math done through BoringMath (SWC-101)
            // C1: Our sun will swallow the earth well before this overflows
            data.strategyStartDate = (block.timestamp + STRATEGY_DELAY).to64();
            emit LogStrategyQueued(token, newStrategy);
        } else {
            require(data.strategyStartDate != 0 && block.timestamp >= data.strategyStartDate, "StrategyManager: Too early");
            if (address(strategy[token]) != address(0)) {
                int256 balanceChange = strategy[token].exit(data.balance);
                // Effects
                if (balanceChange > 0) {
                    uint256 add = uint256(balanceChange);
                    totals[token].addElastic(add);
                    emit LogStrategyProfit(token, add);
                } else if (balanceChange < 0) {
                    uint256 sub = uint256(-balanceChange);
                    totals[token].subElastic(sub);
                    emit LogStrategyLoss(token, sub);
                }

                emit LogStrategyDivest(token, data.balance);
            }
            strategy[token] = pending;
            data.strategyStartDate = 0;
            data.balance = 0;
            pendingStrategy[token] = IStrategy(0);
            emit LogStrategySet(token, newStrategy);
        }
        strategyData[token] = data;
    }

    /// @notice The actual process of yield farming. Executes the strategy of `token`.
    /// Optionally does housekeeping if `balance` is true.
    /// `maxChangeAmount` is relevant for skimming or withdrawing if `balance` is true.
    /// @param token The address of the token for which a strategy is deployed.
    /// @param balance True if housekeeping should be done.
    /// @param maxChangeAmount The maximum amount for either pulling or pushing from/to the `IStrategy` contract.
    // F5 - Checks-Effects-Interactions pattern followed? (SWC-107)
    // F5: Total amount is updated AFTER interaction. But strategy is under our control.
    // F5: Not followed to prevent reentrancy issues with flashloans and BentoBox skims?
    function harvest(
        IERC20 token,
        bool balance,
        uint256 maxChangeAmount
    ) public {
        StrategyData memory data = strategyData[token];
        IStrategy _strategy = strategy[token];
        int256 balanceChange = _strategy.harvest(data.balance, msg.sender);
        if (balanceChange == 0 && !balance) {
            return;
        }

        uint256 totalElastic = totals[token].elastic;

        if (balanceChange > 0) {
            uint256 add = uint256(balanceChange);
            totalElastic = totalElastic.add(add);
            totals[token].elastic = totalElastic.to128();
            emit LogStrategyProfit(token, add);
        } else if (balanceChange < 0) {
            // C1 - All math done through BoringMath (SWC-101)
            // C1: balanceChange could overflow if it's max negative int128.
            // But tokens with balances that large are not supported by the BentoBox.
            uint256 sub = uint256(-balanceChange);
            totalElastic = totalElastic.sub(sub);
            totals[token].elastic = totalElastic.to128();
            data.balance = data.balance.sub(sub.to128());
            emit LogStrategyLoss(token, sub);
        }

        if (balance) {
            uint256 targetBalance = totalElastic.mul(data.targetPercentage) / 100;
            // if data.balance == targetBalance there is nothing to update
            if (data.balance < targetBalance) {
                uint256 amountOut = targetBalance.sub(data.balance);
                if (maxChangeAmount != 0 && amountOut > maxChangeAmount) {
                    amountOut = maxChangeAmount;
                }
                token.safeTransfer(address(_strategy), amountOut);
                data.balance = data.balance.add(amountOut.to128());
                _strategy.skim(amountOut);
                emit LogStrategyInvest(token, amountOut);
            } else if (data.balance > targetBalance) {
                uint256 amountIn = data.balance.sub(targetBalance.to128());
                if (maxChangeAmount != 0 && amountIn > maxChangeAmount) {
                    amountIn = maxChangeAmount;
                }

                uint256 actualAmountIn = _strategy.withdraw(amountIn);

                data.balance = data.balance.sub(actualAmountIn.to128());
                emit LogStrategyDivest(token, actualAmountIn);
            }
        }

        strategyData[token] = data;
    }

    // Contract should be able to receive ETH deposits to support deposit & skim
    // solhint-disable-next-line no-empty-blocks
    receive() external payable {}
}

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

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"wethToken_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"masterContract","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":true,"internalType":"address","name":"cloneAddress","type":"address"}],"name":"LogDeploy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"}],"name":"LogDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"}],"name":"LogFlashLoan","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"protocol","type":"address"}],"name":"LogRegisterProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"masterContract","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"LogSetMasterContractApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogStrategyDivest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogStrategyInvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogStrategyLoss","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogStrategyProfit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"LogStrategyQueued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"LogStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"targetPercentage","type":"uint256"}],"name":"LogStrategyTargetPercentage","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"}],"name":"LogTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"masterContract","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"LogWhiteListMasterContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"}],"name":"LogWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"calls","type":"bytes[]"},{"internalType":"bool","name":"revertOnFail","type":"bool"}],"name":"batch","outputs":[{"internalType":"bool[]","name":"successes","type":"bool[]"},{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IBatchFlashBorrower","name":"borrower","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"batchFlashLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"masterContract","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"useCreate2","type":"bool"}],"name":"deploy","outputs":[{"internalType":"address","name":"cloneAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token_","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"share","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"shareOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IFlashBorrower","name":"borrower","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllPools","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"bool","name":"balance","type":"bool"},{"internalType":"uint256","name":"maxChangeAmount","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"masterContractApproved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"masterContractOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"pendingStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permitToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registerProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"masterContract","type":"address"},{"internalType":"bool","name":"approved","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"setMasterContractApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"contract IStrategy","name":"newStrategy","type":"address"}],"name":"setStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint64","name":"targetPercentage_","type":"uint64"}],"name":"setStrategyTargetPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"strategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"strategyData","outputs":[{"internalType":"uint64","name":"strategyStartDate","type":"uint64"},{"internalType":"uint64","name":"targetPercentage","type":"uint64"},{"internalType":"uint128","name":"balance","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"share","type":"uint256"},{"internalType":"bool","name":"roundUp","type":"bool"}],"name":"toAmount","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"roundUp","type":"bool"}],"name":"toShare","outputs":[{"internalType":"uint256","name":"share","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"totals","outputs":[{"internalType":"uint128","name":"elastic","type":"uint128"},{"internalType":"uint128","name":"base","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"share","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"}],"name":"transferMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"bool","name":"direct","type":"bool"},{"internalType":"bool","name":"renounce","type":"bool"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"masterContract","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"whitelistMasterContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedMasterContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token_","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"share","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"shareOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e06040523480156200001157600080fd5b506040516200495238038062004952833981016040819052620000349162000116565b600080546001600160a01b0319163390811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a34660a081905262000084816200009e565b6080525060601b6001600160601b03191660c0526200016a565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fd7df266aff736d415a9dc14b4158201d612e70d75b9c7f4e375ccfd20aa5166f8330604051602001620000f9949392919062000146565b604051602081830303815290604052805190602001209050919050565b60006020828403121562000128578081fd5b81516001600160a01b03811681146200013f578182fd5b9392505050565b938452602084019290925260408301526001600160a01b0316606082015260800190565b60805160a05160c05160601c6147a9620001a96000398061071d52806109ea5280611f5f52806121405250806110b05250806110e552506147a96000f3fe6080604052600436106101f25760003560e01c80637ecebe001161010d578063d2423b51116100a0578063e30c39781161006f578063e30c397814610598578063f1676d37146105ad578063f18d03cc146105cd578063f483b3da146105ed578063f7888aec1461060d576101f9565b8063d2423b5114610506578063d88ff1f414610527578063da5139ca14610549578063df23b45b14610569576101f9565b8063ac4afa38116100dc578063ac4afa3814610491578063aee4d1b2146104b1578063bafe4f14146104c6578063c0a47c93146104e6576101f9565b80637ecebe001461041c5780638da5cb5b1461043c57806391e0eab51461045157806397da6d3014610471576101f9565b80634e71e0c81161018557806366c6bb0b1161015457806366c6bb0b1461039c57806372cb5d97146103bc578063733a9d7c146103dc5780637c516e94146103fc576101f9565b80634e71e0c8146103195780634ffe34db1461032e5780635108a5581461035c578063566231181461037c576101f9565b80631f54245b116101c15780631f54245b14610297578063228bfd9f146102b75780633644e515146102d75780633e2a9d4e146102f9576101f9565b806302b9446c146101fe578063078dfbe7146102285780630fca88431461024a57806312a90c8a1461026a576101f9565b366101f957005b600080fd5b61021161020c3660046138ad565b61062d565b60405161021f92919061467f565b60405180910390f35b34801561023457600080fd5b50610248610243366004613664565b610af1565b005b34801561025657600080fd5b50610248610265366004613988565b610bd7565b34801561027657600080fd5b5061028a610285366004613577565b610e88565b60405161021f9190613f7e565b6102aa6102a53660046136ae565b610e9d565b60405161021f9190613cf8565b3480156102c357600080fd5b506102aa6102d2366004613577565b611090565b3480156102e357600080fd5b506102ec6110ab565b60405161021f9190613f89565b34801561030557600080fd5b50610248610314366004613a8f565b61110b565b34801561032557600080fd5b506102486111d6565b34801561033a57600080fd5b5061034e610349366004613577565b611263565b60405161021f929190614665565b34801561036857600080fd5b506102aa610377366004613577565b611289565b34801561038857600080fd5b506102ec610397366004613a59565b6112a4565b3480156103a857600080fd5b506102486103b7366004613a19565b6112f8565b3480156103c857600080fd5b506102486103d736600461384b565b6118c1565b3480156103e857600080fd5b506102486103f7366004613637565b611d1f565b34801561040857600080fd5b50610248610417366004613907565b611dc3565b34801561042857600080fd5b506102ec610437366004613577565b611e37565b34801561044857600080fd5b506102aa611e49565b34801561045d57600080fd5b5061028a61046c366004613593565b611e58565b34801561047d57600080fd5b5061021161048c3660046138ad565b611e78565b34801561049d57600080fd5b506102aa6104ac366004613be9565b61228c565b3480156104bd57600080fd5b506102486122b3565b3480156104d257600080fd5b506102aa6104e1366004613577565b6122fa565b3480156104f257600080fd5b506102486105013660046135cb565b612315565b610519610514366004613713565b612624565b60405161021f929190613ee4565b34801561053357600080fd5b5061053c6127b4565b60405161021f9190613e97565b34801561055557600080fd5b506102ec610564366004613a59565b612816565b34801561057557600080fd5b50610589610584366004613577565b612862565b60405161021f939291906146a1565b3480156105a457600080fd5b506102aa61289b565b3480156105b957600080fd5b506102486105c8366004613ac7565b6128aa565b3480156105d957600080fd5b506102486105e836600461385d565b6129fb565b3480156105f957600080fd5b50610248610608366004613778565b612b9f565b34801561061957600080fd5b506102ec61062836600461384b565b612e5f565b600080856001600160a01b038116331480159061065357506001600160a01b0381163014155b156106de57336000908152600260205260409020546001600160a01b0316806106975760405162461bcd60e51b815260040161068e90614482565b60405180910390fd5b6001600160a01b0380821660009081526004602090815260408083209386168352929052205460ff166106dc5760405162461bcd60e51b815260040161068e90614305565b505b6001600160a01b0386166107045760405162461bcd60e51b815260040161068e9061426b565b60006001600160a01b0389161561071b578861073d565b7f00000000000000000000000000000000000000000000000000000000000000005b905061074761349d565b506001600160a01b0381166000908152600860209081526040918290208251808401909352546001600160801b03808216808552600160801b909204169183019190915215158061080857506000826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ce57600080fd5b505afa1580156107e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108069190613b37565b115b6108245760405162461bcd60e51b815260040161068e90614199565b8561087c5761083581886000612e7c565b95506103e861085a61084688612f16565b60208401516001600160801b031690612f43565b6001600160801b0316101561087757600080945094505050610ae6565b61088b565b61088881876001612f78565b96505b6001600160a01b038916301415806108aa57506001600160a01b038a16155b806108d2575080516108ce906001600160801b03166108c884612ff7565b9061309f565b8711155b6108ee5760405162461bcd60e51b815260040161068e9061405e565b6001600160a01b038083166000908152600760209081526040808320938c168352929052205461091e90876130c2565b6001600160a01b038084166000908152600760209081526040808320938d168352929052205561096461095087612f16565b60208301516001600160801b031690612f43565b6001600160801b0316602082015261098f61097e88612f16565b82516001600160801b031690612f43565b6001600160801b0390811682526001600160a01b03808416600090815260086020908152604090912084518154928601518516600160801b029085166001600160801b031990931692909217909316179091558a16610a61577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0886040518263ffffffff1660e01b81526004016000604051808303818588803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b5050505050610a86565b6001600160a01b0389163014610a8657610a866001600160a01b0383168a308a6130e5565b876001600160a01b0316896001600160a01b0316836001600160a01b03167fb2346165e782564f17f5b7e555c21f4fd96fbc93458572bf0113ea35a958fc558a8a604051610ad592919061467f565b60405180910390a486945085935050505b509550959350505050565b6000546001600160a01b03163314610b1b5760405162461bcd60e51b815260040161068e906142d0565b8115610bb6576001600160a01b038316151580610b355750805b610b515760405162461bcd60e51b815260040161068e9061416a565b600080546040516001600160a01b03808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0385166001600160a01b031991821617909155600180549091169055610bd2565b600180546001600160a01b0319166001600160a01b0385161790555b505050565b846001600160a01b0381163314801590610bfa57506001600160a01b0381163014155b15610c7c57336000908152600260205260409020546001600160a01b031680610c355760405162461bcd60e51b815260040161068e90614482565b6001600160a01b0380821660009081526004602090815260408083209386168352929052205460ff16610c7a5760405162461bcd60e51b815260040161068e90614305565b505b600085858281610c8857fe5b9050602002016020810190610c9d9190613577565b6001600160a01b03161415610cc45760405162461bcd60e51b815260040161068e90614234565b600084815b81811015610e20576000888883818110610cdf57fe5b9050602002016020810190610cf49190613577565b9050610d63878784818110610d0557fe5b90506020020135600760008e6001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b03168152602001908152602001600020546130c290919063ffffffff16565b6001600160a01b03808d16600090815260076020908152604080832093861683529290522055610dae878784818110610d9857fe5b90506020020135856130c290919063ffffffff16565b9350806001600160a01b03168a6001600160a01b03168c6001600160a01b03167f6eabe333476233fd382224f233210cb808a7bc4c4de64f9d76628bf63c677b1a8a8a87818110610dfb57fe5b90506020020135604051610e0f9190613f89565b60405180910390a450600101610cc9565b506001600160a01b03808a166000908152600760209081526040808320938c1683529290522054610e51908361309f565b6001600160a01b03998a1660009081526007602090815260408083209b909c16825299909952989097209790975550505050505050565b60056020526000908152604090205460ff1681565b60006001600160a01b038516610ec55760405162461bcd60e51b815260040161068e90614416565b606085901b8215610f375760008585604051610ee2929190613ca2565b60405180910390209050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260148201526e5af43d82803e903d91602b57fd5bf360881b6028820152816037826000f593505050610f7c565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09250505b6001600160a01b038083166000818152600260205260408082208054948b166001600160a01b03199586161790556003805460018101825592527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b909101805490931682179092559051631377d1f560e21b8152634ddf47d49034906110089089908990600401614008565b6000604051808303818588803b15801561102157600080fd5b505af1158015611035573d6000803e3d6000fd5b5050505050816001600160a01b0316866001600160a01b03167fd62166f3c2149208e51788b1401cc356bf5da1fc6c7886a32e18570f57d88b3b878760405161107f929190614008565b60405180910390a350949350505050565b6009602052600090815260409020546001600160a01b031681565b6000467f000000000000000000000000000000000000000000000000000000000000000081146110e3576110de816131de565b611105565b7f00000000000000000000000000000000000000000000000000000000000000005b91505090565b6000546001600160a01b031633146111355760405162461bcd60e51b815260040161068e906142d0565b605f816001600160401b0316111561115f5760405162461bcd60e51b815260040161068e906145fa565b6001600160a01b0382166000818152600b602052604090819020805467ffffffffffffffff60401b1916600160401b6001600160401b03861602179055517f7543af99b5602c06e62da0631b5308489a5ff859150105a623b6eb15e8deae0b906111ca90849061468d565b60405180910390a25050565b6001546001600160a01b03163381146112015760405162461bcd60e51b815260040161068e9061433c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166001600160a01b0319928316179055600180549091169055565b6008602052600090815260409020546001600160801b0380821691600160801b90041682565b600a602052600090815260409020546001600160a01b031681565b6001600160a01b03831660009081526008602090815260408083208151808301909252546001600160801b038082168352600160801b90910416918101919091526112f0908484612f78565b949350505050565b6113006134b4565b506001600160a01b038381166000818152600b60209081526040808320815160608101835290546001600160401b038082168352600160401b82041682850152600160801b90046001600160801b031681830190815294845260099092528083205493519051630c7e663b60e11b81529194939093169283916318fccc769161138d913390600401614643565b602060405180830381600087803b1580156113a757600080fd5b505af11580156113bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113df9190613b37565b9050801580156113ed575084155b156113fa57505050610bd2565b6001600160a01b0386166000908152600860205260408120546001600160801b0316908213156114b0578161142f82826130c2565b915061143a82612f16565b6001600160a01b0389166000818152600860205260409081902080546001600160801b0319166001600160801b03949094169390931790925590517f911c9f20a03edabcbcbd18dca1174cce47a91b234ced7a5a3c60ba0d5b56c5d2906114a2908490613f89565b60405180910390a25061157e565b600082121561157e5760008290036114c8828261309f565b91506114d382612f16565b6001600160a01b038916600090815260086020526040902080546001600160801b0319166001600160801b039290921691909117905561152961151582612f16565b60408701516001600160801b031690613255565b6001600160801b0316604080870191909152516001600160a01b038916907f8f1f26eb9b6aa8689dbdd519ead1999d9c8819d4738e403b2003b18197d9cf9790611574908490613f89565b60405180910390a2505b851561183d57600060646115a886602001516001600160401b03168461328490919063ffffffff16565b816115af57fe5b0490508085604001516001600160801b031610156116ea5760006115e986604001516001600160801b03168361309f90919063ffffffff16565b905086158015906115f957508681115b156116015750855b6116156001600160a01b038a1686836132bb565b61163561162182612f16565b60408801516001600160801b031690612f43565b6001600160801b031660408088019190915251636939aaf560e01b81526001600160a01b03861690636939aaf590611671908490600401613f89565b600060405180830381600087803b15801561168b57600080fd5b505af115801561169f573d6000803e3d6000fd5b50505050886001600160a01b03167fb18e7e4f6eac147a63a3bb6beb2d9039c88698623aff3efc4febbc20b0164ee5826040516116dc9190613f89565b60405180910390a25061183b565b8085604001516001600160801b0316111561183b57600061172161170d83612f16565b60408801516001600160801b031690613255565b6001600160801b03169050861580159061173a57508681115b156117425750855b604051632e1a7d4d60e01b81526000906001600160a01b03871690632e1a7d4d90611771908590600401613f89565b602060405180830381600087803b15801561178b57600080fd5b505af115801561179f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c39190613b37565b90506117e56117d182612f16565b60408901516001600160801b031690613255565b6001600160801b0316604080890191909152516001600160a01b038b16907f39aa22060f8dd4d291720311feedf3b72fef47c06c66ccf5c22b502c62e7550a90611830908490613f89565b60405180910390a250505b505b5050506001600160a01b0384166000908152600b6020908152604091829020835181549285015193909401516001600160801b03908116600160801b026001600160401b03948516600160401b0267ffffffffffffffff60401b199590961667ffffffffffffffff1990941693909317939093169390931791909116179055505050565b6000546001600160a01b031633146118eb5760405162461bcd60e51b815260040161068e906142d0565b6118f36134b4565b506001600160a01b038281166000818152600b60209081526040808320815160608101835290546001600160401b038082168352600160401b8204811683860152600160801b9091046001600160801b031682840152948452600a9092529091205481519193169116158061197a5750826001600160a01b0316816001600160a01b031614155b15611a04576001600160a01b038481166000908152600a6020526040902080546001600160a01b0319169185169190911790556119bb6203f48042016133b1565b6001600160401b031682526040516001600160a01b0380851691908616907f6f7ccdf3f86039e5a1dcf6028bf7b4773cbf7a234716ba2e5392b12bb0f8558f90600090a3611c9f565b81516001600160401b031615801590611a27575081516001600160401b03164210155b611a435760405162461bcd60e51b815260040161068e90614299565b6001600160a01b038481166000908152600960205260409020541615611c28576001600160a01b0380851660009081526009602052604080822054858201519151637f8661a160e01b815292931691637f8661a191611aa49160040161462f565b602060405180830381600087803b158015611abe57600080fd5b505af1158015611ad2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af69190613b37565b90506000811315611b6d576001600160a01b03851660009081526008602052604090208190611b2590826133da565b50856001600160a01b03167f911c9f20a03edabcbcbd18dca1174cce47a91b234ced7a5a3c60ba0d5b56c5d282604051611b5f9190613f89565b60405180910390a250611be1565b6000811215611be1576001600160a01b03851660009081526008602052604081209082900390611b9d908261341e565b50856001600160a01b03167f8f1f26eb9b6aa8689dbdd519ead1999d9c8819d4738e403b2003b18197d9cf9782604051611bd79190613f89565b60405180910390a2505b846001600160a01b03167f39aa22060f8dd4d291720311feedf3b72fef47c06c66ccf5c22b502c62e7550a8460400151604051611c1e919061462f565b60405180910390a2505b6001600160a01b03808516600081815260096020908152604080832080548688166001600160a01b031991821617909155838852878201849052848452600a909252808320805490921690915551928616927f03e6352a885adc4cc54767592939c3b1bbd65685658c3beaaba66a888120e2179190a35b506001600160a01b03929092166000908152600b60209081526040918290208451815492860151939095015167ffffffffffffffff199092166001600160401b039586161767ffffffffffffffff60401b1916600160401b9590931694909402919091176001600160801b03908116600160801b91909216021790915550565b6000546001600160a01b03163314611d495760405162461bcd60e51b815260040161068e906142d0565b6001600160a01b038216611d6f5760405162461bcd60e51b815260040161068e90614095565b6001600160a01b03821660008181526005602052604090819020805460ff1916841515179055517f31a1e0eac44b54ac6c2a2efa87e92c83405ffcf33fceef02a7bca695130e2600906111ca908490613f7e565b60405163d505accf60e01b81526001600160a01b0389169063d505accf90611dfb908a908a908a908a908a908a908a90600401613e3d565b600060405180830381600087803b158015611e1557600080fd5b505af1158015611e29573d6000803e3d6000fd5b505050505050505050505050565b60066020526000908152604090205481565b6000546001600160a01b031681565b600460209081526000928352604080842090915290825290205460ff1681565b600080856001600160a01b0381163314801590611e9e57506001600160a01b0381163014155b15611f2057336000908152600260205260409020546001600160a01b031680611ed95760405162461bcd60e51b815260040161068e90614482565b6001600160a01b0380821660009081526004602090815260408083209386168352929052205460ff16611f1e5760405162461bcd60e51b815260040161068e90614305565b505b6001600160a01b038616611f465760405162461bcd60e51b815260040161068e9061426b565b60006001600160a01b03891615611f5d5788611f7f565b7f00000000000000000000000000000000000000000000000000000000000000005b9050611f8961349d565b506001600160a01b0381166000908152600860209081526040918290208251808401909352546001600160801b038082168452600160801b909104169082015285611fe157611fda81886001612e7c565b9550611ff0565b611fed81876000612f78565b96505b6001600160a01b038083166000908152600760209081526040808320938d1683529290522054612020908761309f565b6001600160a01b038084166000908152600760209081526040808320938e168352929052205561206361205288612f16565b82516001600160801b031690613255565b6001600160801b0316815261208e61207a87612f16565b60208301516001600160801b031690613255565b6001600160801b0316602082018190526103e81115806120b9575060208101516001600160801b0316155b6120d55760405162461bcd60e51b815260040161068e9061413a565b6001600160a01b03828116600090815260086020908152604090912083518154928501516001600160801b03199093166001600160801b03918216178116600160801b91909316029190911790558a1661222957604051632e1a7d4d60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632e1a7d4d90612175908a90600401613f89565b600060405180830381600087803b15801561218f57600080fd5b505af11580156121a3573d6000803e3d6000fd5b505050506000886001600160a01b0316886040516121c090613cf5565b60006040518083038185875af1925050503d80600081146121fd576040519150601f19603f3d011682016040523d82523d6000602084013e612202565b606091505b50509050806122235760405162461bcd60e51b815260040161068e9061458c565b5061223d565b61223d6001600160a01b03831689896132bb565b876001600160a01b0316896001600160a01b0316836001600160a01b03167fad9ab9ee6953d4d177f4a03b3a3ac3178ffcb9816319f348060194aa76b144868a8a604051610ad592919061467f565b6003818154811061229957fe5b6000918252602090912001546001600160a01b0316905081565b3360008181526002602052604080822080546001600160a01b03191684179055517fdfb44ffabf0d3a8f650d3ce43eff98f6d050e7ea1a396d5794f014e7dadabacb9190a2565b6002602052600090815260409020546001600160a01b031681565b6001600160a01b03851661233b5760405162461bcd60e51b815260040161068e9061444b565b81158015612347575080155b8015612354575060ff8316155b156123f6576001600160a01b03861633146123815760405162461bcd60e51b815260040161068e906140cc565b6001600160a01b0386811660009081526002602052604090205416156123b95760405162461bcd60e51b815260040161068e906143a8565b6001600160a01b03851660009081526005602052604090205460ff166123f15760405162461bcd60e51b815260040161068e90614555565b6125b0565b6001600160a01b03861661241c5760405162461bcd60e51b815260040161068e906144ee565b600060405180604001604052806002815260200161190160f01b8152506124416110ab565b7f1962bc9f5484cb7a998701b81090e966ee1fce5771af884cceee7c081b14ade28761248d577fb426802f1f7dc850a7b6b38805edea2442f3992878a9ab985abfe8091d95d0b16124af565b7f422ac5323fe049241dee67716229a1cc1bc7b313b23dfe3ef6d42ab177a3b2845b6001600160a01b038b1660009081526006602090815260409182902080546001810190915591516124e99493928e928e928e929101613f92565b6040516020818303038152906040528051906020012060405160200161251193929190613cce565b60405160208183030381529060405280519060200120905060006001828686866040516000815260200160405260405161254e9493929190613fea565b6020604051602081039080840390855afa158015612570573d6000803e3d6000fd5b505050602060405103519050876001600160a01b0316816001600160a01b0316146125ad5760405162461bcd60e51b815260040161068e906143df565b50505b6001600160a01b038581166000818152600460209081526040808320948b168084529490915290819020805460ff1916881515179055517f5f6ebb64ba012a851c6f014e6cad458ddf213d1512049b31cd06365c2b05925790612614908890613f7e565b60405180910390a3505050505050565b606080836001600160401b038111801561263d57600080fd5b50604051908082528060200260200182016040528015612667578160200160208202803683370190505b509150836001600160401b038111801561268057600080fd5b506040519080825280602002602001820160405280156126b457816020015b606081526020019060019003908161269f5790505b50905060005b848110156127ab5760006060308888858181106126d357fe5b90506020028101906126e591906146cd565b6040516126f3929190613ca2565b600060405180830381855af49150503d806000811461272e576040519150601f19603f3d011682016040523d82523d6000602084013e612733565b606091505b50915091508180612742575085155b61274b8261343d565b906127695760405162461bcd60e51b815260040161068e919061401c565b508185848151811061277757fe5b6020026020010190151590811515815250508084848151811061279657fe5b602090810291909101015250506001016126ba565b50935093915050565b6060600380548060200260200160405190810160405280929190818152602001828054801561280c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116127ee575b5050505050905090565b6001600160a01b03831660009081526008602090815260408083208151808301909252546001600160801b038082168352600160801b90910416918101919091526112f0908484612e7c565b600b602052600090815260409020546001600160401b0380821691600160401b810490911690600160801b90046001600160801b031683565b6001546001600160a01b031681565b6000620186a06128bb856032613284565b816128c257fe5b0490506128d96001600160a01b03861687866132bb565b6040516323e30c8b60e01b81526001600160a01b038816906323e30c8b9061290f9033908990899087908a908a90600401613dd2565b600060405180830381600087803b15801561292957600080fd5b505af115801561293d573d6000803e3d6000fd5b5050505061297461294d82612f16565b6001600160a01b0387166000908152600860205260409020906001600160801b03166133da565b61297d86612ff7565b101561299b5760405162461bcd60e51b815260040161068e90614525565b856001600160a01b0316856001600160a01b0316886001600160a01b03167f3be9b85936d5d30a1655ea116a17ee3d827b2cd428cc026ce5bf2ac46a22320487856040516129ea92919061467f565b60405180910390a450505050505050565b826001600160a01b0381163314801590612a1e57506001600160a01b0381163014155b15612aa057336000908152600260205260409020546001600160a01b031680612a595760405162461bcd60e51b815260040161068e90614482565b6001600160a01b0380821660009081526004602090815260408083209386168352929052205460ff16612a9e5760405162461bcd60e51b815260040161068e90614305565b505b6001600160a01b038316612ac65760405162461bcd60e51b815260040161068e9061426b565b6001600160a01b03808616600090815260076020908152604080832093881683529290522054612af6908361309f565b6001600160a01b03868116600090815260076020908152604080832089851684529091528082209390935590851681522054612b3290836130c2565b6001600160a01b0380871660008181526007602090815260408083208986168085529252918290209490945551918716917f6eabe333476233fd382224f233210cb808a7bc4c4de64f9d76628bf63c677b1a90612b90908790613f89565b60405180910390a45050505050565b6060856001600160401b0381118015612bb757600080fd5b50604051908082528060200260200182016040528015612be1578160200160208202803683370190505b5090508560005b81811015612cb0576000878783818110612bfe57fe5b905060200201359050620186a0612c1f60328361328490919063ffffffff16565b81612c2657fe5b04848381518110612c3357fe5b602002602001018181525050612ca78c8c84818110612c4e57fe5b9050602002016020810190612c639190613577565b898985818110612c6f57fe5b905060200201358c8c86818110612c8257fe5b9050602002016020810190612c979190613577565b6001600160a01b031691906132bb565b50600101612be8565b5060405163d9d1762360e01b81526001600160a01b038c169063d9d1762390612ceb9033908c908c908c908c908a908d908d90600401613d0c565b600060405180830381600087803b158015612d0557600080fd5b505af1158015612d19573d6000803e3d6000fd5b5050505060005b81811015611e29576000898983818110612d3657fe5b9050602002016020810190612d4b9190613577565b9050612d93612d6c858481518110612d5f57fe5b6020026020010151612f16565b6001600160a01b0383166000908152600860205260409020906001600160801b03166133da565b612d9c82612ff7565b1015612dba5760405162461bcd60e51b815260040161068e90614525565b8b8b83818110612dc657fe5b9050602002016020810190612ddb9190613577565b6001600160a01b0316816001600160a01b03168e6001600160a01b03167f3be9b85936d5d30a1655ea116a17ee3d827b2cd428cc026ce5bf2ac46a2232048b8b87818110612e2557fe5b90506020020135888781518110612e3857fe5b6020026020010151604051612e4e92919061467f565b60405180910390a450600101612d20565b600760209081526000928352604080842090915290825290205481565b82516000906001600160801b0316612e95575081612f0f565b835160208501516001600160801b0391821691612eb491869116613284565b81612ebb57fe5b049050818015612eff57508284602001516001600160801b0316612ef586600001516001600160801b03168461328490919063ffffffff16565b81612efc57fe5b04105b15612f0f576112f08160016130c2565b9392505050565b60006001600160801b03821115612f3f5760405162461bcd60e51b815260040161068e906141c6565b5090565b8181016001600160801b038083169082161015612f725760405162461bcd60e51b815260040161068e906141fd565b92915050565b600083602001516001600160801b031660001415612f97575081612f0f565b602084015184516001600160801b0391821691612fb691869116613284565b81612fbd57fe5b049050818015612eff57508284600001516001600160801b0316612ef586602001516001600160801b03168461328490919063ffffffff16565b6001600160a01b0381166000818152600b60205260408082205490516370a0823160e01b81529192612f7292600160801b9092046001600160801b0316916370a0823190613049903090600401613cf8565b60206040518083038186803b15801561306157600080fd5b505afa158015613075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130999190613b37565b906130c2565b80820382811115612f725760405162461bcd60e51b815260040161068e9061402f565b81810181811015612f725760405162461bcd60e51b815260040161068e906141fd565b60006060856001600160a01b03166323b872dd60e01b86868660405160240161311093929190613e19565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161314e9190613cb2565b6000604051808303816000865af19150503d806000811461318b576040519150601f19603f3d011682016040523d82523d6000602084013e613190565b606091505b50915091508180156131ba5750805115806131ba5750808060200190518101906131ba919061375c565b6131d65760405162461bcd60e51b815260040161068e906144b9565b505050505050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fd7df266aff736d415a9dc14b4158201d612e70d75b9c7f4e375ccfd20aa5166f83306040516020016132379493929190613fc6565b6040516020818303038152906040528051906020012090505b919050565b8082036001600160801b038084169082161115612f725760405162461bcd60e51b815260040161068e9061402f565b600081158061329f5750508082028282828161329c57fe5b04145b612f725760405162461bcd60e51b815260040161068e906145c3565b60006060846001600160a01b031663a9059cbb60e01b85856040516024016132e4929190613e7e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516133229190613cb2565b6000604051808303816000865af19150503d806000811461335f576040519150601f19603f3d011682016040523d82523d6000602084013e613364565b606091505b509150915081801561338e57508051158061338e57508080602001905181019061338e919061375c565b6133aa5760405162461bcd60e51b815260040161068e90614103565b5050505050565b60006001600160401b03821115612f3f5760405162461bcd60e51b815260040161068e90614371565b60006133f96133e883612f16565b84546001600160801b031690612f43565b83546001600160801b0319166001600160801b03919091169081179093555090919050565b60006133f961342c83612f16565b84546001600160801b031690613255565b6060604482511015613483575060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c790000006020820152613250565b60048201915081806020019051810190612f729190613b4f565b604080518082019091526000808252602082015290565b604080516060810182526000808252602082018190529181019190915290565b60008083601f8401126134e5578182fd5b5081356001600160401b038111156134fb578182fd5b602083019150836020808302850101111561351557600080fd5b9250929050565b60008083601f84011261352d578182fd5b5081356001600160401b03811115613543578182fd5b60208301915083602082850101111561351557600080fd5b8035612f728161474d565b803560ff81168114612f7257600080fd5b600060208284031215613588578081fd5b8135612f0f8161474d565b600080604083850312156135a5578081fd5b82356135b08161474d565b915060208301356135c08161474d565b809150509250929050565b60008060008060008060c087890312156135e3578182fd5b86356135ee8161474d565b955060208701356135fe8161474d565b9450604087013561360e81614765565b935061361d8860608901613566565b92506080870135915060a087013590509295509295509295565b60008060408385031215613649578182fd5b82356136548161474d565b915060208301356135c081614765565b600080600060608486031215613678578283fd5b83356136838161474d565b9250602084013561369381614765565b915060408401356136a381614765565b809150509250925092565b600080600080606085870312156136c3578384fd5b84356136ce8161474d565b935060208501356001600160401b038111156136e8578384fd5b6136f48782880161351c565b909450925050604085013561370881614765565b939692955090935050565b600080600060408486031215613727578081fd5b83356001600160401b0381111561373c578182fd5b613748868287016134d4565b90945092505060208401356136a381614765565b60006020828403121561376d578081fd5b8151612f0f81614765565b600080600080600080600080600060a08a8c031215613795578687fd5b89356137a08161474d565b985060208a01356001600160401b03808211156137bb578889fd5b6137c78d838e016134d4565b909a50985060408c01359150808211156137df578485fd5b6137eb8d838e016134d4565b909850965060608c0135915080821115613803578485fd5b61380f8d838e016134d4565b909650945060808c0135915080821115613827578384fd5b506138348c828d0161351c565b915080935050809150509295985092959850929598565b600080604083850312156135a5578182fd5b60008060008060808587031215613872578182fd5b843561387d8161474d565b9350602085013561388d8161474d565b9250604085013561389d8161474d565b9396929550929360600135925050565b600080600080600060a086880312156138c4578283fd5b85356138cf8161474d565b945060208601356138df8161474d565b935060408601356138ef8161474d565b94979396509394606081013594506080013592915050565b600080600080600080600080610100898b031215613923578182fd5b883561392e8161474d565b9750602089013561393e8161474d565b9650604089013561394e8161474d565b9550606089013594506080890135935061396b8a60a08b01613566565b925060c0890135915060e089013590509295985092959890939650565b600080600080600080608087890312156139a0578384fd5b86356139ab8161474d565b955060208701356139bb8161474d565b945060408701356001600160401b03808211156139d6578586fd5b6139e28a838b016134d4565b909650945060608901359150808211156139fa578384fd5b50613a0789828a016134d4565b979a9699509497509295939492505050565b600080600060608486031215613a2d578081fd5b8335613a388161474d565b92506020840135613a4881614765565b929592945050506040919091013590565b600080600060608486031215613a6d578081fd5b8335613a788161474d565b92506020840135915060408401356136a381614765565b60008060408385031215613aa1578182fd5b8235613aac8161474d565b915060208301356001600160401b03811681146135c0578182fd5b60008060008060008060a08789031215613adf578384fd5b8635613aea8161474d565b95506020870135613afa8161474d565b94506040870135613b0a8161474d565b93506060870135925060808701356001600160401b03811115613b2b578283fd5b613a0789828a0161351c565b600060208284031215613b48578081fd5b5051919050565b600060208284031215613b60578081fd5b81516001600160401b0380821115613b76578283fd5b818401915084601f830112613b89578283fd5b815181811115613b97578384fd5b604051601f8201601f191681016020018381118282101715613bb7578586fd5b604052818152838201602001871015613bce578485fd5b613bdf82602083016020870161471d565b9695505050505050565b600060208284031215613bfa578081fd5b5035919050565b6001600160a01b0316815260200190565b6000815180845260208085019450808401835b83811015613c4157815187529582019590820190600101613c25565b509495945050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452613c8e81602086016020860161471d565b601f01601f19169290920160200192915050565b6000828483379101908152919050565b60008251613cc481846020870161471d565b9190910192915050565b60008451613ce081846020890161471d565b91909101928352506020820152604001919050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b038916815260a0602080830182905260009183019081613d338b82613f89565b90508b9250835b8b811015613d6557828401613d5883613d53838861355b565b613c01565b9094509150600101613d3a565b508481036040860152613d788982613f89565b9250506001600160fb1b03881115613d8e578283fd5b8702613d9b81838b614711565b018281036060840152613dae8187613c12565b90508281036080840152613dc3818587613c4c565b9b9a5050505050505050505050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a060808201819052600090613e0d9083018486613c4c565b98975050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015613ed85783516001600160a01b031683529284019291840191600101613eb3565b50909695505050505050565b604080825283519082018190526000906020906060840190828701845b82811015613f1f578151151584529284019290840190600101613f01565b50505083810382850152808551613f368184613f89565b91508192508381028201848801865b83811015613f6f578583038552613f5d838351613c76565b94870194925090860190600101613f45565b50909998505050505050505050565b901515815260200190565b90815260200190565b95865260208601949094526001600160a01b039283166040860152911660608401521515608083015260a082015260c00190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526112f0602083018486613c4c565b600060208252612f0f6020830184613c76565b602080825260159082015274426f72696e674d6174683a20556e646572666c6f7760581b604082015260600190565b60208082526017908201527f42656e746f426f783a20536b696d20746f6f206d756368000000000000000000604082015260600190565b6020808252601c908201527f4d6173746572434d67723a2043616e6e6f7420617070726f7665203000000000604082015260600190565b6020808252601b908201527f4d6173746572434d67723a2075736572206e6f742073656e6465720000000000604082015260600190565b6020808252601c908201527f426f72696e6745524332303a205472616e73666572206661696c656400000000604082015260600190565b60208082526016908201527542656e746f426f783a2063616e6e6f7420656d70747960501b604082015260600190565b6020808252601590820152744f776e61626c653a207a65726f206164647265737360581b604082015260600190565b60208082526013908201527242656e746f426f783a204e6f20746f6b656e7360681b604082015260600190565b6020808252601c908201527f426f72696e674d6174683a2075696e74313238204f766572666c6f7700000000604082015260600190565b60208082526018908201527f426f72696e674d6174683a20416464204f766572666c6f770000000000000000604082015260600190565b60208082526017908201527f42656e746f426f783a20746f5b305d206e6f7420736574000000000000000000604082015260600190565b60208082526014908201527310995b9d1bd09bde0e881d1bc81b9bdd081cd95d60621b604082015260600190565b6020808252601a908201527f53747261746567794d616e616765723a20546f6f206561726c79000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f42656e746f426f783a205472616e73666572206e6f7420617070726f76656400604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604082015260600190565b6020808252601b908201527f426f72696e674d6174683a2075696e743634204f766572666c6f770000000000604082015260600190565b60208082526019908201527f4d6173746572434d67723a207573657220697320636c6f6e6500000000000000604082015260600190565b6020808252601d908201527f4d6173746572434d67723a20496e76616c6964205369676e6174757265000000604082015260600190565b6020808252818101527f426f72696e67466163746f72793a204e6f206d6173746572436f6e7472616374604082015260600190565b6020808252601b908201527f4d6173746572434d67723a206d617374657243206e6f74207365740000000000604082015260600190565b6020808252601b908201527f42656e746f426f783a206e6f206d6173746572436f6e74726163740000000000604082015260600190565b6020808252818101527f426f72696e6745524332303a205472616e7366657246726f6d206661696c6564604082015260600190565b6020808252601c908201527f4d6173746572434d67723a20557365722063616e6e6f74206265203000000000604082015260600190565b60208082526016908201527510995b9d1bd09bde0e8815dc9bdb99c8185b5bdd5b9d60521b604082015260600190565b6020808252601b908201527f4d6173746572434d67723a206e6f742077686974656c69737465640000000000604082015260600190565b6020808252601d908201527f42656e746f426f783a20455448207472616e73666572206661696c6564000000604082015260600190565b60208082526018908201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604082015260600190565b6020808252818101527f53747261746567794d616e616765723a2054617267657420746f6f2068696768604082015260600190565b6001600160801b0391909116815260200190565b6001600160801b039290921682526001600160a01b0316602082015260400190565b6001600160801b0392831681529116602082015260400190565b918252602082015260400190565b6001600160401b0391909116815260200190565b6001600160401b0393841681529190921660208201526001600160801b03909116604082015260600190565b6000808335601e198436030181126146e3578283fd5b8301803591506001600160401b038211156146fc578283fd5b60200191503681900382131561351557600080fd5b82818337506000910152565b60005b83811015614738578181015183820152602001614720565b83811115614747576000848401525b50505050565b6001600160a01b038116811461476257600080fd5b50565b801515811461476257600080fdfea2646970667358221220bfb213b896017a142311cdafda587bfdfd8e2168a4f828aa83ba788f31253ef764736f6c634300060c0033000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7

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

000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7

-----Decoded View---------------
Arg [0] : wethToken_ (address): 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7


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.