💻
- https://dtr.org & https://alluo.io & https://getunblock.com
- @0xtuytuy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function execute(Entry[] memory _entries) external onlyRole(DEFAULT_ADMIN_ROLE){ | |
uint8 totalWeight; | |
for(uint256 i = 0; i < _entries.length; i++){ | |
totalWeight += _entries[i].weight; | |
require(entryTokens.contains(_entries[i].entryToken), "There is no such entry token"); | |
} | |
require(totalWeight <= 100, "Total weight more then 100"); | |
uint256 totalBalance = getTotalBalance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function executeSwap( | |
address pool, | |
address fromToken, | |
address toToken, | |
uint256 amount | |
) external payable returns (uint256) { | |
ICurve3Crv pool3crv = ICurve3Crv(pool); | |
if (toToken == address(token3crv)) { | |
// enter 3crv pool to get 3crv token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daiWethRoute = [ | |
// DAI - USDT - WETH | |
{ swapProtocol: 1, pool: fraxPoolAddress, fromCoin: dai.address, toCoin: usdt.address }, | |
{ swapProtocol: 2, pool: renbtcAddress, fromCoin: usdt.address, toCoin: weth.address }, | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"weight":50, | |
"entryToken"://address of the token we hold that we want to use to enter the Cure pool A, | |
"curvePool"://address of the Curve pool A to enter, | |
"poolToken"://address of the token we want to enter the Curve pool A with, | |
"poolSize"://how many entry coins does this Curve pool A have, | |
"tokenIndexInCurve"://what index in the previous list is our prefered poolToken, | |
"convexPoolAddress": //address of the Convex pool A we want to invest the Cuve LP tokens into, | |
"convexPoold"://id of the Convex pool A |