Skip to content

Commit

Permalink
Updates to Gnosis DAO and LTD in gno Disassemble presets
Browse files Browse the repository at this point in the history
  • Loading branch information
nledo committed Feb 6, 2024
1 parent e8b394b commit 94914cb
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 } from "../../helpers/ExitStrategies/HoldingsExitStrategies"
import { HoldingsExitStrategy, WstEthExitStrategy1 } from "../../helpers/ExitStrategies/HoldingsExitStrategies"
import { staticEqual, staticOneOf } from "../../helpers/utils"
import { AVATAR } from "../../placeholders"
import { RolePreset } from "../../types"
Expand All @@ -27,6 +27,8 @@ const preset = {

...HoldingsExitStrategy(100), // 100 = Gnosis Chain

...WstEthExitStrategy1(100), // wstETH -> WETH

//---------------------------------------------------------------------------------------------------------------------------------
// Curve
//---------------------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { allow } from "../../allow"
import { auraExitStrategy2 } from "../../helpers/ExitStrategies/AuraExitStrategies"
import { balancerExitStrategy1 } from "../../helpers/ExitStrategies/BalancerExitStrategies"
import { WstEthExitStrategy1 } from "../../helpers/ExitStrategies/HoldingsExitStrategies"
import { AVATAR } from "../../placeholders"
import { RolePreset } from "../../types"
import { aura, balancer, WXDAI, realt } from "../addresses"

const preset = {
network: 100,
allow: [
//---------------------------------------------------------------------------------------------------------------------------------
// Holdings
//---------------------------------------------------------------------------------------------------------------------------------

...WstEthExitStrategy1(100), // wstETH -> WETH

//---------------------------------------------------------------------------------------------------------------------------------
// Aura sBAL3 + Balancer sBAL3
//---------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -19,6 +27,24 @@ const preset = {

...auraExitStrategy2(aura.aurastaBAL3_REWARDER, balancer.staBAL3_pId),

//---------------------------------------------------------------------------------------------------------------------------------
// Aura wstETH/COW + Balancer wstETH/COW
//---------------------------------------------------------------------------------------------------------------------------------

...auraExitStrategy2(aura.auraB_50wstETH_50COW_REWARDER, balancer.B_50wstETH_50COW_pId),

//---------------------------------------------------------------------------------------------------------------------------------
// Balancer GBPe/WXDAI
//---------------------------------------------------------------------------------------------------------------------------------

...balancerExitStrategy1(balancer.B_50GBPe_50WXDAI_pId),

//---------------------------------------------------------------------------------------------------------------------------------
// Balancer GBPe/EURe
//---------------------------------------------------------------------------------------------------------------------------------

...balancerExitStrategy1(balancer.B_50EURe_50GBPe_pId),

//---------------------------------------------------------------------------------------------------------------------------------
// SushiSwap
//---------------------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions packages/sdk/src/presets/gnosisChain/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const aura = {
auraEURe_sDAI_REWARDER: "0xDE151980d461696543aa07A19BbE2603B20ECbAE",
aurasBAL3_REWARDER: "0x7513105D6cF9D18756D95DeD81D6d3F68dB4b8DA",
aurastaBAL3_REWARDER: "0x0821ed041620b83b306FfaC74Df3FA855cEDe51A",
auraB_50wstETH_50COW_REWARDER: "0x85298595D4F6F8Fa91f8658BA9c10f9A85B17f62",
}

export const balancer = {
Expand Down Expand Up @@ -133,6 +134,10 @@ export const balancer = {
B_EURe_sDAI: "0xDd439304A77f54B1F7854751Ac1169b279591Ef7",
B_EURe_sDAI_pId:
"0xdd439304a77f54b1f7854751ac1169b279591ef7000000000000000000000064",
B_50GBPe_50WXDAI: "0xEA54604e7E1DdEc8320cF838CFE857FbF44Aad9f",
B_50GBPe_50WXDAI_pId: "0xea54604e7e1ddec8320cf838cfe857fbf44aad9f000200000000000000000078",
B_50EURe_50GBPe: "0xC5Df11757F4A8DFACcC731d13b9577f67055c6c6",
B_50EURe_50GBPe_pId: "0xc5df11757f4a8dfaccc731d13b9577f67055c6c6000200000000000000000077"
}

export const cowswap = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@ export const balancerExitStrategy1 = (
},
]
}

export const balancerExitStrategy2 = (
gauge: string
): PresetAllowEntry[] => {
return [
{
...allow.mainnet.balancer.B_50WETH_50AURA_gauge["withdraw(uint256)"],
targetAddress: gauge,
},
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,58 @@ export const EthExitStrategy3 = (
return permissions
}

export const WstEthExitStrategy1 = (
blockchainId: NetworkId
): PresetAllowEntry[] => {
const permissions: PresetAllowEntry[] = []

switch (blockchainId) {
case 1:
permissions.push(
...allowErc20Approve(
[mainnetAddresses.wstETH],
[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.wstETH, "address"),
[1]: staticEqual(mainnetAddresses.E_ADDRESS, "address"),
[2]: staticEqual(AVATAR),
},
delegatecall: true,
}
)
break

case 100:
permissions.push(
...allowErc20Approve(
[gnoAddresses.wstETH],
[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.wstETH, "address"),
[1]: staticEqual(gnoAddresses.WETH, "address"),
[2]: staticEqual(AVATAR),
},
delegatecall: true,
}
)
break
}

return permissions
}

export const HoldingsExitStrategy = (
blockchainId: NetworkId
): PresetAllowEntry[] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { lidoExitStrategyAll } from "../../helpers/ExitStrategies/LidoExitStrate
import { staticEqual } from "../../helpers/utils"
import { AVATAR } from "../../placeholders"
import { USDC, aura, balancer, compound_v2, compound_v3 } from "../addresses"
import { RolePreset } from "../../types"

const preset = {
network: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { HoldingsExitStrategy } from "../../helpers/ExitStrategies/HoldingsExitS
import { lidoExitStrategyAll } from "../../helpers/ExitStrategies/LidoExitStrategies"
import { AVATAR } from "../../placeholders"
import { USDC, aura, balancer } from "../addresses"
import { RolePreset } from "../../types"

const preset = {
network: 1,
Expand Down

0 comments on commit 94914cb

Please sign in to comment.