customIntegrationsEnabled
can create strategies that use custom integrations.CustomIntegrationTemplate.sol
that you can copy and paste and rename to start working on your custom integration.CustomIntegrationYearn
to see how to connect with Yearn using the template.CustomIntegrationTemplate.sol
and rename it.test_
sample_
change_me
_getSpender
, this function returns the address where the input tokens need to be approved to before execution. This address will be called with ERC-20 approve and the input tokens before execution._getResultToken
. This function must return the result token (ERC-20) to be received after executing the enter operation._tokenDenominator
_customOp
will be 0 for enter and 1 for exit. If this action needs to execute an ERC approval you can fill _preActionNeedsApproval
._customOp
will be 0 for enter and 1 for exit. If this action needs to execute an ERC approval you can fill _postActionNeedsApproval
._getPrice(address _tokenIn, address _tokenOut) view returns (uint256)
_tokenIn
denominated in _tokenOut
from our price oracle (1e18). It will return an exception if it doesn't know how to price a specific token._getDurationStrategy(address _strategy) view returns (uint256)
_getTokenOrETHBalance(address _strategy, address _token) view returns (uint256)
_token
. If token is 0x or 0xEEEE..EEE, it will return the ETH balance of the strategy._getTradeCallData(address _strategy, address _tokenIn, address _tokenOut, uint256 _amountIn, uint256 _minAmountOut) view returns (address, uint, bytes memory)
_tokenIn
to _tokenOut.
The number of _tokenIn supplied is specified by_amountIn
. The call will revert if you don't receive at least _minAmountOut
. It returns the address, callvalue, and calldata to pass directly to a preaction hook, postaction hook, enter or exit functionscontracts
repository there is a test file that executes the yearn custom integration example. In order to test your integration, follow these steps:yarn run test
. That's it, you can start debugging πcontracts
repo.#development
channel.