Skip to content

Commit

Permalink
Set by default MultiSendCallOnly as trusted for delegates (#1803)
Browse files Browse the repository at this point in the history
* Set by default MultiSendCallOnly as trusted for delegates
  • Loading branch information
moisses89 authored Dec 18, 2023
1 parent 694221c commit 1b4e8ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from config.settings.base import STATICFILES_DIRS
from safe_transaction_service.contracts.models import Contract

TRUSTED_FOR_DELEGATE_CALL = ["MultiSendCallOnly"]


def generate_safe_contract_display_name(contract_name: str, version: str) -> str:
"""
Expand Down Expand Up @@ -87,6 +89,8 @@ def handle(self, *args, **options):
defaults={
"name": contract_name,
"display_name": display_name,
"trusted_for_delegate_call": contract_name
in TRUSTED_FOR_DELEGATE_CALL,
},
)

Expand Down
10 changes: 10 additions & 0 deletions safe_transaction_service/contracts/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def test_update_safe_contracts_logo(self, mock_chain_id):
contract = Contract.objects.get(address=safe_l2_130_address)
self.assertEqual(contract.name, "GnosisSafeL2")
self.assertEqual(contract.display_name, "SafeL2 1.3.0")
self.assertFalse(contract.trusted_for_delegate_call)

safe_multisend_130_address = "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761"
contract = Contract.objects.get(address=safe_multisend_130_address)
Expand All @@ -82,3 +83,12 @@ def test_update_safe_contracts_logo(self, mock_chain_id):
contract = Contract.objects.get(address=multisend_address)
self.assertEqual(contract.name, "MultiSendCallOnly")
self.assertEqual(contract.display_name, "Safe: MultiSendCallOnly 1.3.0")
# MultiSendCallOnly should be trusted for delegate calls
self.assertTrue(contract.trusted_for_delegate_call)

multisend_141_address = "0x9641d764fc13c8B624c04430C7356C1C7C8102e2"
contract = Contract.objects.get(address=multisend_141_address)
self.assertEqual(contract.name, "MultiSendCallOnly")
self.assertEqual(contract.display_name, "Safe: MultiSendCallOnly 1.4.1")
# MultiSendCallOnly should be trusted for delegate calls
self.assertTrue(contract.trusted_for_delegate_call)

0 comments on commit 1b4e8ad

Please sign in to comment.