Skip to content

Commit

Permalink
Add Gnosis safe owner modification gas per tx option
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Jan 8, 2025
1 parent 4ccde18 commit 96408b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/safe-integration/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Trading Strategy module as a Safe module using Zodiac.

[TradingStrategyModuleV0](./src/TradingStrategyModuleV0.sol) is a Zodiac-module for Gnosis Safe multisignature wallets.
It enables automated trading, "trading algorithms" or "AI-agent", for various use cases.
It enables automated trading, "trading algorithms" or "AI-agent", for various use cases.`

- You can assign an asset management role for an automated system
- The asset manager can perform automated trades allowed by whitelist-based rules
Expand Down
8 changes: 6 additions & 2 deletions eth_defi/safe/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def add_new_safe_owners(
deployer: LocalAccount,
owners: list[HexAddress | str],
threshold: int,
gas_per_tx=500_000,
):
"""Update Safe owners and threshold list.
Expand All @@ -89,6 +90,9 @@ def add_new_safe_owners(
We cannot remove deployer account from the list, but it must be done by the new owners
:param gas_per_tx:
Gas limit for a single transaction.
More info:
- https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L56C14-L56C35
Expand All @@ -113,7 +117,7 @@ def add_new_safe_owners(
continue

tx = safe.contract.functions.addOwnerWithThreshold(owner, 1).build_transaction(
{"from": deployer.address, "gas": 0, "gasPrice": 0}
{"from": deployer.address, "gas": gas_per_tx, "gasPrice": 0}
)
safe_tx = safe.build_multisig_tx(safe.address, 0, tx["data"])
safe_tx.sign(deployer._private_key.hex())
Expand All @@ -124,7 +128,7 @@ def add_new_safe_owners(

# Change the threshold
tx = safe.contract.functions.changeThreshold(threshold).build_transaction(
{"from": deployer.address, "gas": 0, "gasPrice": 0}
{"from": deployer.address, "gas": gas_per_tx, "gasPrice": 0}
)
safe_tx = safe.build_multisig_tx(safe.address, 0, tx["data"])
safe_tx.sign(deployer._private_key.hex())
Expand Down

0 comments on commit 96408b9

Please sign in to comment.