Skip to content

Commit

Permalink
feat: add fantom support
Browse files Browse the repository at this point in the history
  • Loading branch information
banteg committed Sep 13, 2021
1 parent 734519f commit 6afa1d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions ape_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@


MULTISEND_CALL_ONLY = '0x40A2aCCbd92BCA938b02010E17A5b8929b49130D'
multisends = {
250: '0x10B62CC1E8D9a9f1Ad05BCC491A7984697c19f7E',
}
transaction_service = {
1: 'https://safe-transaction.mainnet.gnosis.io',
4: 'https://safe-transaction.rinkeby.gnosis.io',
5: 'https://safe-transaction.goerli.gnosis.io',
56: 'https://safe-transaction.bsc.gnosis.io',
100: 'https://safe-transaction.xdai.gnosis.io',
137: 'https://safe-transaction.polygon.gnosis.io',
250: 'https://safe.fantom.network',
246: 'https://safe-transaction.ewc.gnosis.io',
42161: 'https://safe-transaction.arbitrum.gnosis.io',
73799: 'https://safe-transaction.volta.gnosis.io',
Expand All @@ -39,16 +43,15 @@ class ApiError(Exception):

class ApeSafe(Safe):

def __init__(self, address, base_url=None, multisend=MULTISEND_CALL_ONLY):
def __init__(self, address, base_url=None, multisend=None):
"""
Create an ApeSafe from an address or a ENS name and use a default connection.
"""
if not web3.isChecksumAddress(address):
address = web3.ens.resolve(address)
ethereum_client = EthereumClient(web3.provider.endpoint_uri)
self.multisend = multisend
if base_url is None:
self.base_url = transaction_service[chain.id]
self.base_url = base_url or transaction_service[chain.id]
self.multisend = multisend or multisends.get(chain.id, MULTISEND_CALL_ONLY)
super().__init__(address, ethereum_client)

def __str__(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ape-safe"
version = "0.2.0"
version = "0.2.1"
description = "Build complex Gnosis Safe transactions and safely preview them in a forked environment."
authors = ["banteg <banteeg@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 6afa1d7

Please sign in to comment.