# DegenBox

Degenbox is an authorized fork of [**BentoBox**](https://docs.sushi.com/products/bentobox) (as Abracadabra purchased the licence for it). Cauldrons are built on top of both BentoBox and Degenbox, which allow users to reduce transaction fees as well as allow the creation of multiple strategies for the assets held inside.

Please do not send funds directly to either BentoBox or Degenbox as they will be lost! Use the "Deposit" function instead!

### `Constructor`​ <a href="#constructor" id="constructor"></a>

#### `nonpayable`[​](https://smart-docs.vercel.app/contract#constructor) <a href="#constructor" id="constructor"></a>

**Parameters**

| Name            | Type      | Description      |
| --------------- | --------- | ---------------- |
| **wethToken\_** | `address` | address of WETH. |

### Functions <a href="#functions" id="functions"></a>

#### [​](https://smart-docs.vercel.app/contract#functions)View Functions <a href="#functions" id="functions"></a>

* [DOMAIN\_SEPARATOR](#domain_separator)
* [balanceOf](#balanceof)
* [masterContractApproved](#mastercontractapproved)
* [masterContractOf](#mastercontractof)
* [nonces](#nonces)
* [owner](#owner)
* [pendingOwner](#pendingowner)
* [pendingStrategy](#pendingstrategy)
* [strategy](#strategy)
* [strategyData](#strategydata)
* [toAmount](#toamount)
* [toShare](#toshare)
* [totals](#totals)
* [whitelistedMasterContracts](#whitelistedmastercontracts)

#### Write Functions

* [batch](#batch)
* [batchFlashLoan](#batchflashloan)
* [claimOwnership](#claimownership)
* [deploy](#deploy)
* [deposit](#deposit)
* [flashLoan](#flashloan)
* [harvest](#harvest)
* [permitToken](#permittoken)
* [registerProtocol](#registerprotocol)
* [setMasterContractApproval](#setmastercontractapproval)
* [setStrategy](#setstrategy)
* [setStrategyTargetPercentage](#setstrategytargetpercentage)
* [transfer](#transfer)
* [transferMultiple](#transfermultiple)
* [transferOwnership](#transferownership)
* [whitelistMasterContract](#whitelistmastercontract)
* [withdraw](#withdraw)

***

#### `DOMAIN_SEPARATOR | view`[​](https://smart-docs.vercel.app/contract#DOMAIN_SEPARATOR) <a href="#domain_separator" id="domain_separator"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `bytes32` |

#### `balanceOf | view`[​](https://smart-docs.vercel.app/contract#balanceOf) <a href="#balanceof" id="balanceof"></a>

```solidity
mapping(IERC20 => mapping(address => uint256)) public balanceOf
```

**Parameters**

| Name  | Type      | Description                          |
| ----- | --------- | ------------------------------------ |
| **/** | `address` | Token to check                       |
| **/** | `address` | The address which balance is checked |

**Return values**

| Name  | Type      | Description                          |
| ----- | --------- | ------------------------------------ |
| **/** | `uint256` | Shares of 'token' owned by 'address' |

#### `batch | payable`[​](https://smart-docs.vercel.app/contract#batch) <a href="#batch" id="batch"></a>

```solidity
function batch(bytes[] calldata calls, bool revertOnFail) 
    external payable 
    returns (bool[] memory successes, bytes[] memory results) 
```

**Parameters**

| Name             | Type      | Description                                                             |
| ---------------- | --------- | ----------------------------------------------------------------------- |
| **calls**        | `bytes[]` | An array of inputs for each call.                                       |
| **revertOnFail** | `bool`    | If True then reverts after a failed call and stops doing further calls. |

**Return values**

| Name          | Type      | Description                                                                          |
| ------------- | --------- | ------------------------------------------------------------------------------------ |
| **successes** | `bool[]`  | An array indicating the success of a call, mapped one-to-one to `calls`.             |
| **results**   | `bytes[]` | An array with the returned data of each function call, mapped one-to-one to `calls`. |

#### `batchFlashLoan | nonpayable`[​](https://smart-docs.vercel.app/contract#batchFlashLoan) <a href="#batchflashloan" id="batchflashloan"></a>

```solidity
function batchFlashLoan(
    IBatchFlashBorrower borrower,
    address[] calldata receivers,
    IERC20[] calldata tokens,
    uint256[] calldata amounts,
    bytes calldata data
) public {
```

**Parameters**

| Name          | Type        | Description                                                                                                  |
| ------------- | ----------- | ------------------------------------------------------------------------------------------------------------ |
| **borrower**  | `address`   | The address of the contract that implements and conforms to `IBatchFlashBorrower` and handles the flashloan. |
| **receivers** | `address[]` | The address of the contract that implements and conforms to `IBatchFlashBorrower` and handles the flashloan. |
| **tokens**    | `address[]` | The addresses of the tokens.                                                                                 |
| **amounts**   | `uint256[]` | amounts of the tokens for each receiver.                                                                     |
| **data**      | `bytes`     | The calldata to pass to the `borrower` contract.                                                             |

**Return values**

No return values for this function.

#### `claimOwnership | nonpayable`[​](https://smart-docs.vercel.app/contract#claimOwnership) <a href="#claimownership" id="claimownership"></a>

```solidity
function claimOwnership() public 
```

Needs to be called by `pendingOwner` to claim ownership.

#### `deploy | payable`[​](https://smart-docs.vercel.app/contract#deploy) <a href="#deploy" id="deploy"></a>

```solidity
function deploy(
    address masterContract,
    bytes calldata data,
    bool useCreate2
) public payable returns (address cloneAddress)
```

Deploys a given master Contract as a clone.

**Parameters**

| Name               | Type      | Description                                                                                 |
| ------------------ | --------- | ------------------------------------------------------------------------------------------- |
| **masterContract** | `address` | The address of the contract to clone.                                                       |
| **data**           | `bytes`   | Additional abi encoded calldata that is passed to the new clone via `IMasterContract.init`. |
| **useCreate2**     | `bool`    | Creates the clone by using the CREATE2 opcode, in this case `data` will be used as salt.    |

**Return values**

| Name             | Type      | Description                            |
| ---------------- | --------- | -------------------------------------- |
| **cloneAddress** | `address` | Address of the created clone contract. |

#### `deposit | payable`[​](https://smart-docs.vercel.app/contract#deposit) <a href="#deposit" id="deposit"></a>

```solidity
function deposit(
    IERC20 token_,
    address from,
    address to,
    uint256 amount,
    uint256 share
) public payable allowed(from) returns (uint256 amountOut, uint256 shareOut)
```

**Parameters**

| Name        | Type      | Description                                                                    |
| ----------- | --------- | ------------------------------------------------------------------------------ |
| **token\_** | `address` | The ERC-20 token to deposit.                                                   |
| **from**    | `address` | which account to pull the tokens from.                                         |
| **to**      | `address` | which account to push the tokens to.                                           |
| **amount**  | `uint256` | Token amount in native representation to deposit.                              |
| **share**   | `uint256` | Token amount represented in shares to deposit. Takes precedence over `amount`. |

**Return values**

| Name          | Type      |                                             |
| ------------- | --------- | ------------------------------------------- |
| **amountOut** | `uint256` | The amount deposited.                       |
| **shareOut**  | `uint256` | The deposited amount represented in shares. |

#### `flashLoan | nonpayable`[​](https://smart-docs.vercel.app/contract#flashLoan) <a href="#flashloan" id="flashloan"></a>

```solidity
function flashLoan(
    IFlashBorrower borrower,
    address receiver,
    IERC20 token,
    uint256 amount,
    bytes calldata data
) public
```

**Parameters**

| Name         | Type      |                                                                                                         |
| ------------ | --------- | ------------------------------------------------------------------------------------------------------- |
| **borrower** | `address` | The address of the contract that implements and conforms to `IFlashBorrower` and handles the flashloan. |
| **receiver** | `address` | Address of the token receiver.                                                                          |
| **token**    | `address` | The address of the token to receive.                                                                    |
| **amount**   | `uint256` | Amount of the tokens to receive.                                                                        |
| **data**     | `bytes`   | The calldata to pass to the `borrower` contract.                                                        |

**Return values**

No return values for this function.

#### `harvest | nonpayable`[​](https://smart-docs.vercel.app/contract#harvest) <a href="#harvest" id="harvest"></a>

```solidity
function harvest(
    IERC20 token,
    bool balance,
    uint256 maxChangeAmount
) public
```

The actual process of yield farming. Executes the strategy of `token`. Optionally does housekeeping if `balance` is true.

**Parameters**

| Name                | Type      | Description                                                                        |
| ------------------- | --------- | ---------------------------------------------------------------------------------- |
| **token**           | `address` | The address of the token for which a strategy is deployed.                         |
| **balance**         | `bool`    | True if housekeeping should be done.                                               |
| **maxChangeAmount** | `uint256` | The maximum amount for either pulling or pushing from/to the `IStrategy` contract. |

**Return values**

No return values for this function.

#### `masterContractApproved | view`[​](https://smart-docs.vercel.app/contract#masterContractApproved) <a href="#mastercontractapproved" id="mastercontractapproved"></a>

```solidity
mapping(address => mapping(address => bool)) public masterContractApproved;
```

masterContract to user to approval state, returns True if the user has approved the masterContract.

**Parameters**

| Name  | Type      | Description                    |
| ----- | --------- | ------------------------------ |
| **/** | `address` | Address of the masterContract. |
| **/** | `address` | Address of the user.           |

**Return values**

| Name  | Type   | Description                                             |
| ----- | ------ | ------------------------------------------------------- |
| **/** | `bool` | Returns True if the masterContract is approved by user. |

#### `masterContractOf | view`[​](https://smart-docs.vercel.app/contract#masterContractOf) <a href="#mastercontractof" id="mastercontractof"></a>

```solidity
mapping(address => address) public masterContractOf;
```

Mapping from clone contracts to their masterContract.

**Parameters**

| Name  | Type      | Description                     |
| ----- | --------- | ------------------------------- |
| **/** | `address` | Address of the cloned contract. |

**Return values**

| Name  | Type      | Description                                                  |
| ----- | --------- | ------------------------------------------------------------ |
| **/** | `address` | Address of the masterContract clone contract is cloned from. |

#### `nonces | view`[​](https://smart-docs.vercel.app/contract#nonces) <a href="#nonces" id="nonces"></a>

```solidity
mapping(address => uint256) public nonces;
```

User nonces for masterContract approvals.

**Parameters**

| Name  | Type      | Description   |
| ----- | --------- | ------------- |
| **/** | `address` | User address. |

**Return values**

| Name  | Type      | Description        |
| ----- | --------- | ------------------ |
| **/** | `uint256` | Nonce of the user. |

#### `owner | view`[​](https://smart-docs.vercel.app/contract#owner) <a href="#owner" id="owner"></a>

Owner of the DegenBox contract. Can perform actions that onlyOwner() can perform, such as strategy updates.

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      | Description          |
| ----- | --------- | -------------------- |
| **/** | `address` | Address of the Owner |

#### `pendingOwner | view`[​](https://smart-docs.vercel.app/contract#pendingOwner) <a href="#pendingowner" id="pendingowner"></a>

When transferring ownership, the future owner is pending until they claims ownership.

**Return values**

| Name  | Type      | Description                   |
| ----- | --------- | ----------------------------- |
| **/** | `address` | Address of the pending owner. |

#### `pendingStrategy | view`[​](https://smart-docs.vercel.app/contract#pendingStrategy) <a href="#pendingstrategy" id="pendingstrategy"></a>

Strategy change being submitted to a delay of 3 days, the setStrategy function is called twice, once to declare a strategy change, and another time after STRATEGY\_DELAY (3 days). In between those calls, the new strategy is pendingStrategy.

**Parameters**

| Name  | Type      | Description                                                 |
| ----- | --------- | ----------------------------------------------------------- |
| **/** | `address` | The address of the token that maps to a strategy to change. |

**Return values**

| Name  | Type      | Description                                               |
| ----- | --------- | --------------------------------------------------------- |
| **/** | `address` | The address of the contract that conforms to `IStrategy`. |

#### `permitToken | nonpayable`[​](https://smart-docs.vercel.app/contract#permitToken) <a href="#permittoken" id="permittoken"></a>

```solidity
function permitToken(
        IERC20 token,
        address from,
        address to,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public
```

**Parameters**

<table><thead><tr><th>Name</th><th width="374">Type</th><th></th></tr></thead><tbody><tr><td><strong>token</strong></td><td><code>address</code></td><td>The ERC20 token that supports permit to call permit on.</td></tr><tr><td><strong>from</strong></td><td><code>address</code></td><td>The token owner's address</td></tr><tr><td><strong>to</strong></td><td><code>address</code></td><td>The token spender's address</td></tr><tr><td><strong>amount</strong></td><td><code>uint256</code></td><td>The amount to be approved.</td></tr><tr><td><strong>deadline</strong></td><td><code>uint256</code></td><td>Timestamp in the future until which permit can be called.</td></tr><tr><td><strong>v</strong></td><td><code>uint8</code></td><td>v of the ECDSA signature.</td></tr><tr><td><strong>r</strong></td><td><code>bytes32</code></td><td>r of the ECDSA signature.</td></tr><tr><td><strong>s</strong></td><td><code>bytes32</code></td><td>s of the ECDSA signature.</td></tr></tbody></table>

**Return values**

No return values for this function.

#### `registerProtocol | nonpayable`[​](https://smart-docs.vercel.app/contract#registerProtocol) <a href="#registerprotocol" id="registerprotocol"></a>

**Parameters**

No parameters for this function.

**Return values**

No return values for this function.

#### `setMasterContractApproval | nonpayable`[​](https://smart-docs.vercel.app/contract#setMasterContractApproval) <a href="#setmastercontractapproval" id="setmastercontractapproval"></a>

**Parameters**

| Name               | Type      |
| ------------------ | --------- |
| **user**           | `address` |
| **masterContract** | `address` |
| **approved**       | `bool`    |
| **v**              | `uint8`   |
| **r**              | `bytes32` |
| **s**              | `bytes32` |

**Return values**

No return values for this function.

#### `setStrategy | nonpayable`[​](https://smart-docs.vercel.app/contract#setStrategy) <a href="#setstrategy" id="setstrategy"></a>

```solidity
function setStrategy(IERC20 token, IStrategy newStrategy) public onlyOwner
```

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. In the case of the Degenbox, `STRATEGY_DELAY` is 3 days.

**Parameters**

| Name            | Type      | Description                                                 |
| --------------- | --------- | ----------------------------------------------------------- |
| **token**       | `address` | The address of the token that maps to a strategy to change. |
| **newStrategy** | `address` | The address of the contract that conforms to `IStrategy`.   |

**Return values**

No return values for this function.

#### `setStrategyTargetPercentage | nonpayable`[​](https://smart-docs.vercel.app/contract#setStrategyTargetPercentage) <a href="#setstrategytargetpercentage" id="setstrategytargetpercentage"></a>

```solidity
function setStrategyTargetPercentage(
         IERC20 token, 
         uint64 targetPercentage_
      ) public onlyOwner {
```

Sets the target percentage of the strategy for `token`. It corresponds to the percentage of tokens deployed to the Strategy, vs kept in DegenBox.

**Parameters**

| Name                   | Type      | Description                                                                    |
| ---------------------- | --------- | ------------------------------------------------------------------------------ |
| **token**              | `address` | The address of the token that maps to a strategy to change.                    |
| **targetPercentage\_** | `uint64`  | The new target in percent. Must be lesser or equal to `MAX_TARGET_PERCENTAGE`. |

**Return values**

No return values for this function.

#### `strategy | view`[​](https://smart-docs.vercel.app/contract#strategy) <a href="#strategy" id="strategy"></a>

Returns the address of the Strategy mapped to the given ERC20 token.

**Parameters**

| Name  | Type      | Description                                      |
| ----- | --------- | ------------------------------------------------ |
| **/** | `address` | The address of the token that maps to a strategy |

**Return values**

| Name  | Type      |                                                                               |
| ----- | --------- | ----------------------------------------------------------------------------- |
| **/** | `address` | The address of the current strategy: a contract that conforms to `IStrategy`. |

#### `strategyData | view`[​](https://smart-docs.vercel.app/contract#strategyData) <a href="#strategydata" id="strategydata"></a>

**Parameters**

| Name  | Type      | Description                                      |
| ----- | --------- | ------------------------------------------------ |
| **/** | `address` | The address of the token that maps to a strategy |

**Return values**

| Name                  | Type      | Description                                                           |
| --------------------- | --------- | --------------------------------------------------------------------- |
| **strategyStartDate** | `uint64`  | Timestamp of the strategy start date.                                 |
| **targetPercentage**  | `uint64`  | Current targetPercentage (% of funds wanted in strategy) of the token |
| **balance**           | `uint128` | Current balance held by strategy (before harvest)                     |

#### `toAmount | view`[​](https://smart-docs.vercel.app/contract#toAmount) <a href="#toamount" id="toamount"></a>

```solidity
function toAmount(
    IERC20 token,
    uint256 share,
    bool roundUp
) external view returns (uint256 amount)
```

Converts amounts of shares of a token into it's native representation.

**Parameters**

| Name        | Type      | Description                         |
| ----------- | --------- | ----------------------------------- |
| **token**   | `address` | The ERC-20 token.                   |
| **share**   | `uint256` | The amount of shares.               |
| **roundUp** | `bool`    | If the result should be rounded up. |

**Return values**

| Name       | Type      | Description                                       |
| ---------- | --------- | ------------------------------------------------- |
| **amount** | `uint256` | The share amount back into native representation. |

#### `toShare | view`[​](https://smart-docs.vercel.app/contract#toShare) <a href="#toshare" id="toshare"></a>

```solidity
function toShare(
    IERC20 token,
    uint256 amount,
    bool roundUp
) external view returns (uint256 share)
```

Converts amounts of a token in it's native representation into shares.

**Parameters**

| Name        | Type      | Description                                 |
| ----------- | --------- | ------------------------------------------- |
| **token**   | `address` | The ERC-20 token.                           |
| **amount**  | `uint256` | The `token` amount.                         |
| **roundUp** | `bool`    | If the result `share` should be rounded up. |

**Return values**

| Name      | Type      | Description                             |
| --------- | --------- | --------------------------------------- |
| **share** | `uint256` | The token amount represented in shares. |

#### `totals | view`[​](https://smart-docs.vercel.app/contract#totals) <a href="#totals" id="totals"></a>

```solidity
mapping(IERC20 => Rebase) public totals;
```

Keeps track of how many tokens are stored by DegenBox as well as how many shares are held by users.

**Parameters**

| Name  | Type      | Description                        |
| ----- | --------- | ---------------------------------- |
| **/** | `address` | ERC20 Address which total we want. |

**Return values**

| Name        | Type      |                                                                         |
| ----------- | --------- | ----------------------------------------------------------------------- |
| **elastic** | `uint128` | How many tokens (in native representation) are deposited into DegenBox. |
| **base**    | `uint128` | How many shares of tokens are held by users.                            |

#### `transfer | nonpayable`[​](https://smart-docs.vercel.app/contract#transfer) <a href="#transfer" id="transfer"></a>

```solidity
function transfer(
    IERC20 token,
    address from,
    address to,
    uint256 share
) public allowed(from) 
```

Transfer shares from a user account to another one.

**Parameters**

| Name      | Type      |                                       |
| --------- | --------- | ------------------------------------- |
| **token** | `address` | The ERC20 token to transfer.          |
| **from**  | `address` | The account to transfer `token` from. |
| **to**    | `address` | The account to transfer `token` to.   |
| **share** | `uint256` | The amount of shares to transfer.     |

**Return values**

No return values for this function.

#### `transferMultiple | nonpayable`[​](https://smart-docs.vercel.app/contract#transferMultiple) <a href="#transfermultiple" id="transfermultiple"></a>

```solidity
function transferMultiple(
    IERC20 token,
    address from,
    address[] calldata tos,
    uint256[] calldata shares
) public allowed(from) {
```

Transfer shares from a user account to multiple other ones.

**Parameters**

| Name       | Type        |                                                             |
| ---------- | ----------- | ----------------------------------------------------------- |
| **token**  | `address`   | The ERC20 token to transfer.                                |
| **from**   | `address`   | The account to transfer `token` from.                       |
| **tos**    | `address[]` | The accounts to transfer `token` to.                        |
| **shares** | `uint256[]` | The amount of `token` in shares for each receiver in `tos`. |

**Return values**

No return values for this function.

#### `transferOwnership | nonpayable`[​](https://smart-docs.vercel.app/contract#transferOwnership) <a href="#transferownership" id="transferownership"></a>

```solidity
function transferOwnership(
    address newOwner,
    bool direct,
    bool renounce
) public onlyOwner 
```

Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner. Can only be invoked by the current `owner`.

**Parameters**

| Name         | Type      | Description                                                                                           |
| ------------ | --------- | ----------------------------------------------------------------------------------------------------- |
| **newOwner** | `address` | Address of the new owner.                                                                             |
| **direct**   | `bool`    | True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.      |
| **renounce** | `bool`    | Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise. |

**Return values**

No return values for this function.

#### `whitelistMasterContract | nonpayable`[​](https://smart-docs.vercel.app/contract#whitelistMasterContract) <a href="#whitelistmastercontract" id="whitelistmastercontract"></a>

<pre class="language-solidity"><code class="lang-solidity">function whitelistMasterContract(
<strong>    address masterContract, 
</strong>    bool approved
) public onlyOwner
</code></pre>

Enables or disables a contract for approval without signed message.

**Parameters**

| Name               | Type      | Description                                   |
| ------------------ | --------- | --------------------------------------------- |
| **masterContract** | `address` | masterContract which status is being changed. |
| **approved**       | `bool`    | New approval status.                          |

**Return values**

No return values for this function.

#### `whitelistedMasterContracts | view`[​](https://smart-docs.vercel.app/contract#whitelistedMasterContracts) <a href="#whitelistedmastercontracts" id="whitelistedmastercontracts"></a>

Returns True if a masterContract is whitelisted.

**Parameters**

| Name  | Type      | Description                    |
| ----- | --------- | ------------------------------ |
| **/** | `address` | Address of the masterContract. |

**Return values**

| Name  | Type   | Description          |
| ----- | ------ | -------------------- |
| **/** | `bool` | Whitelisting status. |

#### `withdraw | nonpayable`[​](https://smart-docs.vercel.app/contract#withdraw) <a href="#withdraw" id="withdraw"></a>

```solidity
function withdraw(
    IERC20 token_,
    address from,
    address to,
    uint256 amount,
    uint256 share
) public allowed(from) returns (uint256 amountOut, uint256 shareOut) 
```

Withdraws an amount of `token` from a user account.

**Parameters**

| Name        | Type      | Description                                                               |
| ----------- | --------- | ------------------------------------------------------------------------- |
| **token\_** | `address` | The ERC-20 token to withdraw.                                             |
| **from**    | `address` | From which user to pull the tokens.                                       |
| **to**      | `address` | To which user to push the tokens.                                         |
| **amount**  | `uint256` | Amount of tokens. Either one of `amount` or `share` needs to be supplied. |
| **share**   | `uint256` | Like above, but `share` takes precedence over `amount`.                   |

**Return values**

| Name          | Type      | Description                                          |
| ------------- | --------- | ---------------------------------------------------- |
| **amountOut** | `uint256` | Amount of token withdrawn, in native representation. |
| **shareOut**  | `uint256` | Shares of token withdrawn.                           |

### Events (for EVM logging)[​](https://smart-docs.vercel.app/contract#events-for-evm-logging) <a href="#events-for-evm-logging" id="events-for-evm-logging"></a>

* [LogDeploy](#logdeploy)
* [LogDeposit](#logdeposit)
* [LogFlashLoan](#logflashloan)
* [LogRegisterProtocol](#logregisterprotocol)
* [LogSetMasterContractApproval](#logsetmastercontractapproval)
* [LogStrategyDivest](#logstrategydivest)
* [LogStrategyInvest](#logstrategyinvest)
* [LogStrategyLoss](https://smart-docs.vercel.app/contract#LogStrategyLoss)
* [LogStrategyProfit](#logstrategyprofit)
* [LogStrategyQueued](#logstrategyqueued)
* [LogStrategySet](#logstrategyset)
* [LogStrategyTargetPercentage](#logstrategytargetpercentage)
* [LogTransfer](#logtransfer)
* [LogWhiteListMasterContract](#logwhitelistmastercontract)
* [LogWithdraw](#logwithdraw)
* [OwnershipTransferred](#ownershiptransferred)

***

#### `LogDeploy`[​](https://smart-docs.vercel.app/contract#LogDeploy) <a href="#logdeploy" id="logdeploy"></a>

**Parameters**

| Name               | Type      | Indexed |
| ------------------ | --------- | ------- |
| **masterContract** | `address` | `true`  |
| **data**           | `bytes`   | `false` |
| **cloneAddress**   | `address` | `true`  |

#### `LogDeposit`[​](https://smart-docs.vercel.app/contract#LogDeposit) <a href="#logdeposit" id="logdeposit"></a>

**Parameters**

| Name       | Type      | Indexed |
| ---------- | --------- | ------- |
| **token**  | `address` | `true`  |
| **from**   | `address` | `true`  |
| **to**     | `address` | `true`  |
| **amount** | `uint256` | `false` |
| **share**  | `uint256` | `false` |

#### `LogFlashLoan`[​](https://smart-docs.vercel.app/contract#LogFlashLoan) <a href="#logflashloan" id="logflashloan"></a>

**Parameters**

| Name          | Type      | Indexed |
| ------------- | --------- | ------- |
| **borrower**  | `address` | `true`  |
| **token**     | `address` | `true`  |
| **amount**    | `uint256` | `false` |
| **feeAmount** | `uint256` | `false` |
| **receiver**  | `address` | `true`  |

#### `LogRegisterProtocol`[​](https://smart-docs.vercel.app/contract#LogRegisterProtocol) <a href="#logregisterprotocol" id="logregisterprotocol"></a>

**Parameters**

| Name         | Type      | Indexed |
| ------------ | --------- | ------- |
| **protocol** | `address` | `true`  |

#### `LogSetMasterContractApproval`[​](https://smart-docs.vercel.app/contract#LogSetMasterContractApproval) <a href="#logsetmastercontractapproval" id="logsetmastercontractapproval"></a>

**Parameters**

| Name               | Type      | Indexed |
| ------------------ | --------- | ------- |
| **masterContract** | `address` | `true`  |
| **user**           | `address` | `true`  |
| **approved**       | `bool`    | `false` |

#### `LogStrategyDivest`[​](https://smart-docs.vercel.app/contract#LogStrategyDivest) <a href="#logstrategydivest" id="logstrategydivest"></a>

**Parameters**

| Name       | Type      | Indexed |
| ---------- | --------- | ------- |
| **token**  | `address` | `true`  |
| **amount** | `uint256` | `false` |

#### `LogStrategyInvest`[​](https://smart-docs.vercel.app/contract#LogStrategyInvest) <a href="#logstrategyinvest" id="logstrategyinvest"></a>

**Parameters**

| Name       | Type      | Indexed |
| ---------- | --------- | ------- |
| **token**  | `address` | `true`  |
| **amount** | `uint256` | `false` |

#### `LogStrategyLoss`[​](https://smart-docs.vercel.app/contract#LogStrategyLoss) <a href="#logstrategyloss" id="logstrategyloss"></a>

**Parameters**

| Name       | Type      | Indexed |
| ---------- | --------- | ------- |
| **token**  | `address` | `true`  |
| **amount** | `uint256` | `false` |

#### `LogStrategyProfit`[​](https://smart-docs.vercel.app/contract#LogStrategyProfit) <a href="#logstrategyprofit" id="logstrategyprofit"></a>

**Parameters**

| Name       | Type      | Indexed |
| ---------- | --------- | ------- |
| **token**  | `address` | `true`  |
| **amount** | `uint256` | `false` |

#### `LogStrategyQueued`[​](https://smart-docs.vercel.app/contract#LogStrategyQueued) <a href="#logstrategyqueued" id="logstrategyqueued"></a>

**Parameters**

| Name         | Type      | Indexed |
| ------------ | --------- | ------- |
| **token**    | `address` | `true`  |
| **strategy** | `address` | `true`  |

#### `LogStrategySet`[​](https://smart-docs.vercel.app/contract#LogStrategySet) <a href="#logstrategyset" id="logstrategyset"></a>

**Parameters**

| Name         | Type      | Indexed |
| ------------ | --------- | ------- |
| **token**    | `address` | `true`  |
| **strategy** | `address` | `true`  |

#### `LogStrategyTargetPercentage`[​](https://smart-docs.vercel.app/contract#LogStrategyTargetPercentage) <a href="#logstrategytargetpercentage" id="logstrategytargetpercentage"></a>

**Parameters**

| Name                 | Type      | Indexed |
| -------------------- | --------- | ------- |
| **token**            | `address` | `true`  |
| **targetPercentage** | `uint256` | `false` |

#### `LogTransfer`[​](https://smart-docs.vercel.app/contract#LogTransfer) <a href="#logtransfer" id="logtransfer"></a>

**Parameters**

| Name      | Type      | Indexed |
| --------- | --------- | ------- |
| **token** | `address` | `true`  |
| **from**  | `address` | `true`  |
| **to**    | `address` | `true`  |
| **share** | `uint256` | `false` |

#### `LogWhiteListMasterContract`[​](https://smart-docs.vercel.app/contract#LogWhiteListMasterContract) <a href="#logwhitelistmastercontract" id="logwhitelistmastercontract"></a>

**Parameters**

| Name               | Type      | Indexed |
| ------------------ | --------- | ------- |
| **masterContract** | `address` | `true`  |
| **approved**       | `bool`    | `false` |

#### `LogWithdraw`[​](https://smart-docs.vercel.app/contract#LogWithdraw) <a href="#logwithdraw" id="logwithdraw"></a>

**Parameters**

| Name       | Type      | Indexed |
| ---------- | --------- | ------- |
| **token**  | `address` | `true`  |
| **from**   | `address` | `true`  |
| **to**     | `address` | `true`  |
| **amount** | `uint256` | `false` |
| **share**  | `uint256` | `false` |

#### `OwnershipTransferred`[​](https://smart-docs.vercel.app/contract#OwnershipTransferred) <a href="#ownershiptransferred" id="ownershiptransferred"></a>

**Parameters**

| Name                 | Type      | Indexed |
| -------------------- | --------- | ------- |
| clo**previousOwner** | `address` | `true`  |
| **newOwner**         | `address` | `true`  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.abracadabra.money/core-contracts/degenbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
