Constructor nonpayable
Parameters
View Functions
whitelistedMasterContracts
Write Functions
setMasterContractApproval
setStrategyTargetPercentage
whitelistMasterContract
DOMAIN_SEPARATOR | view
Parameters No parameters for this function. Return values
balanceOf | view
Parameters
The address which balance is checked
Return values
Shares of 'token' owned by 'address'
batch | payable
Parameters
An array of inputs for each call.
If True then reverts after a failed call and stops doing further calls.
Return values
An array indicating the success of a call, mapped one-to-one to calls.
An array with the returned data of each function call, mapped one-to-one to calls.
batchFlashLoan | nonpayable
Parameters
The address of the contract that implements and conforms to IBatchFlashBorrower and handles the flashloan.
The address of the contract that implements and conforms to IBatchFlashBorrower and handles the flashloan.
The addresses of the tokens.
amounts of the tokens for each receiver.
The calldata to pass to the borrower contract.
Return values
No return values for this function.
claimOwnership | nonpayable
Needs to be called by pendingOwner to claim ownership.
deploy | payable
Deploys a given master Contract as a clone.
Parameters
The address of the contract to clone.
Additional abi encoded calldata that is passed to the new clone via IMasterContract.init.
Creates the clone by using the CREATE2 opcode, in this case data will be used as salt.
Return values
Address of the created clone contract.
deposit | payable
Parameters
The ERC-20 token to deposit.
which account to pull the tokens from.
which account to push the tokens to.
Token amount in native representation to deposit.
Token amount represented in shares to deposit. Takes precedence over amount.
Return values
The deposited amount represented in shares.
flashLoan | nonpayable
Parameters
The address of the contract that implements and conforms to IFlashBorrower and handles the flashloan.
Address of the token receiver.
The address of the token to receive.
Amount of the tokens to receive.
The calldata to pass to the borrower contract.
Return values
No return values for this function.
harvest | nonpayable
The actual process of yield farming. Executes the strategy of token. Optionally does housekeeping if balance is true.
Parameters
The address of the token for which a strategy is deployed.
True if housekeeping should be done.
The maximum amount for either pulling or pushing from/to the IStrategy contract.
Return values
No return values for this function.
masterContractApproved | view
masterContract to user to approval state, returns True if the user has approved the masterContract.
Parameters
Address of the masterContract.
Return values
Returns True if the masterContract is approved by user.
masterContractOf | view
Mapping from clone contracts to their masterContract.
Parameters
Address of the cloned contract.
Return values
Address of the masterContract clone contract is cloned from.
nonces | view
User nonces for masterContract approvals.
Parameters
Return values
Owner of the DegenBox contract. Can perform actions that onlyOwner() can perform, such as strategy updates.
Parameters
No parameters for this function.
Return values
pendingOwner | view
When transferring ownership, the future owner is pending until they claims ownership.
Return values
Address of the pending owner.
pendingStrategy | view
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
The address of the token that maps to a strategy to change.
Return values
The address of the contract that conforms to IStrategy.
permitToken | nonpayable
Parameters
The ERC20 token that supports permit to call permit on.
The token owner's address
The token spender's address
The amount to be approved.
Timestamp in the future until which permit can be called.
v of the ECDSA signature.
r of the ECDSA signature.
s of the ECDSA signature.
Return values No return values for this function.
registerProtocol | nonpayable
Parameters No parameters for this function. Return values No return values for this function.
setMasterContractApproval | nonpayable
Parameters
Return values No return values for this function.
setStrategy | nonpayable
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
The address of the token that maps to a strategy to change.
The address of the contract that conforms to IStrategy.
Return values No return values for this function.
setStrategyTargetPercentage | nonpayable
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
The address of the token that maps to a strategy to change.
The new target in percent. Must be lesser or equal to MAX_TARGET_PERCENTAGE.
Return values No return values for this function.
strategy | view
Returns the address of the Strategy mapped to the given ERC20 token.
Parameters
The address of the token that maps to a strategy
Return values
The address of the current strategy: a contract that conforms to IStrategy.
strategyData | view
Parameters
The address of the token that maps to a strategy
Return values
Timestamp of the strategy start date.
Current targetPercentage (% of funds wanted in strategy) of the token
Current balance held by strategy (before harvest)
toAmount | view
Converts amounts of shares of a token into it's native representation.
Parameters
If the result should be rounded up.
Return values
The share amount back into native representation.
toShare | view
Converts amounts of a token in it's native representation into shares.
Parameters
If the result share should be rounded up.
Return values
The token amount represented in shares.
totals | view
Keeps track of how many tokens are stored by DegenBox as well as how many shares are held by users.
Parameters
ERC20 Address which total we want.
Return values
How many tokens (in native representation) are deposited into DegenBox.
How many shares of tokens are held by users.
transfer | nonpayable
Transfer shares from a user account to another one.
Parameters
The ERC20 token to transfer.
The account to transfer token from.
The account to transfer token to.
The amount of shares to transfer.
Return values No return values for this function.
transferMultiple | nonpayable
Transfer shares from a user account to multiple other ones.
Parameters
The ERC20 token to transfer.
The account to transfer token from.
The accounts to transfer token to.
The amount of token in shares for each receiver in tos.
Return values No return values for this function.
transferOwnership | nonpayable
Transfers ownership to newOwner. Either directly or claimable by the new pending owner. Can only be invoked by the current owner.
Parameters
Address of the new owner.
True if newOwner should be set immediately. False if newOwner needs to use claimOwnership.
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
Enables or disables a contract for approval without signed message.
Parameters
masterContract which status is being changed.
Return values No return values for this function.
whitelistedMasterContracts | view
Returns True if a masterContract is whitelisted.
Parameters
Address of the masterContract.
Return values
withdraw | nonpayable
Withdraws an amount of token from a user account.
Parameters
The ERC-20 token to withdraw.
From which user to pull the tokens.
To which user to push the tokens.
Amount of tokens. Either one of amount or share needs to be supplied.
Like above, but share takes precedence over amount.
Return values
Amount of token withdrawn, in native representation.
Shares of token withdrawn.
Events (for EVM logging)
LogSetMasterContractApproval
LogStrategyTargetPercentage
LogWhiteListMasterContract
Parameters
Parameters
Parameters
LogRegisterProtocol
Parameters
LogSetMasterContractApproval
Parameters
LogStrategyDivest
Parameters
LogStrategyInvest
Parameters
LogStrategyLoss
Parameters
LogStrategyProfit
Parameters
LogStrategyQueued
Parameters
LogStrategySet
Parameters
LogStrategyTargetPercentage
Parameters
Parameters
LogWhiteListMasterContract
Parameters
Parameters
OwnershipTransferred
Parameters