diff --git a/packages/sdk/src/presets/gnosisChain/GnosisDAO/deFiDisassembleGnosisDAO.ts b/packages/sdk/src/presets/gnosisChain/GnosisDAO/deFiDisassembleGnosisDAO.ts index 295badf4b..c540b420d 100644 --- a/packages/sdk/src/presets/gnosisChain/GnosisDAO/deFiDisassembleGnosisDAO.ts +++ b/packages/sdk/src/presets/gnosisChain/GnosisDAO/deFiDisassembleGnosisDAO.ts @@ -3,7 +3,7 @@ import { network } from "hardhat" import { allow } from "../../allow" import { auraExitStrategy2 } from "../../helpers/ExitStrategies/AuraExitStrategies" import { balancerExitStrategy1 } from "../../helpers/ExitStrategies/BalancerExitStrategies" -import { HoldingsExitStrategy, WstEthExitStrategy1 } from "../../helpers/ExitStrategies/HoldingsExitStrategies" +import { HoldingsExitStrategy, sDaiExitStrategy, WstEthExitStrategy1 } from "../../helpers/ExitStrategies/HoldingsExitStrategies" import { staticEqual, staticOneOf } from "../../helpers/utils" import { AVATAR } from "../../placeholders" import { RolePreset } from "../../types" @@ -13,7 +13,6 @@ import { sDAI, USDC, USDT, - WBTC, WETH, wstETH, WXDAI, @@ -34,6 +33,8 @@ const preset = { ...HoldingsExitStrategy(100), // 100 = Gnosis Chain + ...sDaiExitStrategy(100), // Only adds sDAI as buy and sell token + ...WstEthExitStrategy1(100), // wstETH -> WETH //--------------------------------------------------------------------------------------------------------------------------------- diff --git a/packages/sdk/src/presets/gnosisChain/GnosisLTD/deFiDisassembleGnosisLTD.ts b/packages/sdk/src/presets/gnosisChain/GnosisLTD/deFiDisassembleGnosisLTD.ts index 943b00996..16fe8b56f 100644 --- a/packages/sdk/src/presets/gnosisChain/GnosisLTD/deFiDisassembleGnosisLTD.ts +++ b/packages/sdk/src/presets/gnosisChain/GnosisLTD/deFiDisassembleGnosisLTD.ts @@ -1,7 +1,7 @@ import { allow } from "../../allow" import { auraExitStrategy2 } from "../../helpers/ExitStrategies/AuraExitStrategies" import { balancerExitStrategy1 } from "../../helpers/ExitStrategies/BalancerExitStrategies" -import { WstEthExitStrategy1 } from "../../helpers/ExitStrategies/HoldingsExitStrategies" +import { HoldingsExitStrategy, sDaiExitStrategy, WstEthExitStrategy1 } from "../../helpers/ExitStrategies/HoldingsExitStrategies" import { AVATAR } from "../../placeholders" import { RolePreset } from "../../types" import { EURe, sDAI, USDC, USDT, WETH, wstETH, WXDAI, x3CRV, aura, balancer, curve, realt } from "../addresses" @@ -16,6 +16,10 @@ const preset = { // Holdings //--------------------------------------------------------------------------------------------------------------------------------- + ...HoldingsExitStrategy(100), // 100 = Gnosis Chain + + ...sDaiExitStrategy(100), // Only adds sDAI as buy and sell token + ...WstEthExitStrategy1(100), // wstETH -> WETH //--------------------------------------------------------------------------------------------------------------------------------- diff --git a/packages/sdk/src/presets/gnosisChain/KPK/deFiDisassembleKPK.ts b/packages/sdk/src/presets/gnosisChain/KPK/deFiDisassembleKPK.ts index d9217fd94..7bd0c458a 100644 --- a/packages/sdk/src/presets/gnosisChain/KPK/deFiDisassembleKPK.ts +++ b/packages/sdk/src/presets/gnosisChain/KPK/deFiDisassembleKPK.ts @@ -4,11 +4,22 @@ import { RolePreset } from "../../types" import { EURe, sDAI, USDC, USDT, WETH, wstETH, WXDAI, x3CRV, balancer, curve } from "../addresses" import { allowErc20Approve } from "../../helpers/erc20" import { staticEqual, staticOneOf } from "../../helpers/utils" +import { HoldingsExitStrategy, sDaiExitStrategy, WstEthExitStrategy1 } from "../../helpers/ExitStrategies/HoldingsExitStrategies" const preset = { network: 100, allow: [ + //--------------------------------------------------------------------------------------------------------------------------------- + // Holdings + //--------------------------------------------------------------------------------------------------------------------------------- + + ...HoldingsExitStrategy(100), // 100 = Gnosis Chain + + ...sDaiExitStrategy(100), // Only adds sDAI as buy and sell token + + ...WstEthExitStrategy1(100), // wstETH -> WETH + //--------------------------------------------------------------------------------------------------------------------------------- // Balancer //--------------------------------------------------------------------------------------------------------------------------------- diff --git a/packages/sdk/src/presets/helpers/ExitStrategies/HoldingsExitStrategies.ts b/packages/sdk/src/presets/helpers/ExitStrategies/HoldingsExitStrategies.ts index 9a129d7da..b6759912c 100644 --- a/packages/sdk/src/presets/helpers/ExitStrategies/HoldingsExitStrategies.ts +++ b/packages/sdk/src/presets/helpers/ExitStrategies/HoldingsExitStrategies.ts @@ -707,6 +707,60 @@ export const WstEthExitStrategy1 = ( return permissions } +// IMPORTANT: THIS FUNCTION ONLY ADDS sDAI AS BOTH BUY AND SELL TOKEN. IF THIS PERMISSION IS NOT SHARED +// WITH OTHER HOLDINGS STRATEGIES THEN IT'S USELESS. +export const sDaiExitStrategy = ( + blockchainId: NetworkId +): PresetAllowEntry[] => { + const permissions: PresetAllowEntry[] = [] + + switch (blockchainId) { + case 1: + permissions.push( + ...allowErc20Approve( + [mainnetAddresses.sDAI], + [mainnetAddresses.cowswap.GPv2_VAULT_RELAYER] + ), + + { + targetAddress: mainnetAddresses.cowswap.ORDER_SIGNER, + signature: + "signOrder((address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32),uint32,uint256)", + params: { + [0]: staticEqual(mainnetAddresses.sDAI, "address"), + [1]: staticEqual(mainnetAddresses.sDAI, "address"), + [2]: staticEqual(AVATAR), + }, + delegatecall: true, + } + ) + break + + case 100: + permissions.push( + ...allowErc20Approve( + [gnoAddresses.sDAI], + [gnoAddresses.cowswap.GPv2_VAULT_RELAYER] + ), + + { + targetAddress: gnoAddresses.cowswap.ORDER_SIGNER, + signature: + "signOrder((address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32),uint32,uint256)", + params: { + [0]: staticEqual(gnoAddresses.sDAI, "address"), + [1]: staticEqual(gnoAddresses.sDAI, "address"), + [2]: staticEqual(AVATAR), + }, + delegatecall: true, + } + ) + break + } + + return permissions +} + export const HoldingsExitStrategy = ( blockchainId: NetworkId ): PresetAllowEntry[] => { diff --git a/packages/sdk/src/presets/mainnet/addresses.ts b/packages/sdk/src/presets/mainnet/addresses.ts index 9301fbc49..45c60abc1 100644 --- a/packages/sdk/src/presets/mainnet/addresses.ts +++ b/packages/sdk/src/presets/mainnet/addresses.ts @@ -43,6 +43,7 @@ export const rETH = "0xae78736Cd615f374D3085123A210448E74Fc6393" export const rETH2 = "0x20BC832ca081b91433ff6c17f85701B6e92486c5" export const RPL = "0xD33526068D116cE69F19A9ee46F0bd304F21A51f" export const SAFE = "0x5aFE3855358E112B5647B952709E6165e1c1eEEe" +export const sDAI = "0x83F20F44975D03b1b09e64809B757c47f942BEeA" export const sETH2 = "0xFe2e637202056d30016725477c5da089Ab0A043A" export const stETH = "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" export const sUSD = "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51"