Skip to content

Commit

Permalink
Add Gnosis Safe module integration for Trading Strategy (#256)
Browse files Browse the repository at this point in the history
- Integrate `TradingStrategyModuleV0` module to Gnosis Safe-based protocols using Zodiac module
- Mainly needed for Lagoon vaults, but can work for others: vanilla Safe, DAOs
  • Loading branch information
miohtama authored Dec 31, 2024
1 parent 1a24135 commit ac03f42
Show file tree
Hide file tree
Showing 24 changed files with 1,396 additions and 483 deletions.
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@
[submodule "contracts/velvet-core"]
path = contracts/velvet-core
url = https://github.com/Velvet-Capital/velvet-core.git
[submodule "contracts/safe-integration/lib/zodiac"]
path = contracts/safe-integration/lib/zodiac
url = https://github.com/gnosisguild/zodiac.git
[submodule "contracts/safe-integration/lib/safe-contracts"]
path = contracts/safe-integration/lib/safe-contracts
url = [email protected]:safe-global/safe-smart-account.git
[submodule "contracts/safe-integration/lib/openzeppelin-contracts"]
path = contracts/safe-integration/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts.git
[submodule "contracts/safe-integration/lib/openzeppelin-contracts-upgradeable"]
path = contracts/safe-integration/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable.git
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Current

- Mainly needed for Lagoon vaults, but can work for others: vanilla Safe, DAOs
- Add Multicall3 support in `multicall_batcher` module
- Add `SwapRouter02` support on Base for doing Uniswap v3 swaps
- Add Uniswap V3 quoter for the valuation
- Add `buy_tokens()` helper to buy multiple tokens once, automatically look up best routes
- Fix: Base MEV protected broadcast failed
- Add: Integrate `TradingStrategyModuleV0` module to Gnosis Safe-based protocols using Zodiac module. Mainly needed for Lagoon vaults, but can work for others: vanilla Safe, DAOs.

# 0.27

Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ guard:
\) \
-exec cp {} eth_defi/abi/guard \;

# Guard as a safe module
safe-integration:
@mkdir -p eth_defi/abi/safe-integration
@(cd contracts/safe-integration && forge build)
@find contracts/safe-integration/out \
\( \
-name "TradingStrategyModuleV0.json" \
-o \
-name "MockSafe.json" \
\) \
-exec cp {} eth_defi/abi/safe-integration \;

# Terms of service acceptance manager contract
terms-of-service:
@mkdir -p eth_defi/abi/terms-of-service
Expand Down Expand Up @@ -144,7 +156,7 @@ clean-abi:
# Compile all contracts we are using
#
# Move ABI files to within a Python package for PyPi distribution
compile-projects-and-prepare-abi: clean-abi sushi in-house guard copy-uniswapv3-abi aavev3 enzyme dhedge centre 1delta
compile-projects-and-prepare-abi: clean-abi sushi in-house guard safe-integration copy-uniswapv3-abi aavev3 enzyme dhedge centre 1delta

all: clean-docs compile-projects-and-prepare-abi build-docs

Expand Down
2 changes: 2 additions & 0 deletions contracts/guard/remappings.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
@openzeppelin/=lib/openzeppelin-contracts/contracts
@gnosis.pm/=lib

12 changes: 0 additions & 12 deletions contracts/guard/script/Counter.s.sol

This file was deleted.

Loading

0 comments on commit ac03f42

Please sign in to comment.