-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rename `deploy_safe_master_copy` and `deploy_proxy_factory_contract` to `deploy_contract`
- Loading branch information
Showing
36 changed files
with
211 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from abc import ABCMeta, abstractmethod | ||
from functools import cached_property | ||
from logging import getLogger | ||
from typing import Callable, Optional | ||
|
||
from eth_typing import ChecksumAddress | ||
from web3 import Web3 | ||
from web3.contract import Contract | ||
|
||
from .. import EthereumClient | ||
|
||
logger = getLogger(__name__) | ||
|
||
|
||
class ContractBase(metaclass=ABCMeta): | ||
def __init__(self, address: ChecksumAddress, ethereum_client: EthereumClient): | ||
self.address = address | ||
self.ethereum_client = ethereum_client | ||
self.w3 = ethereum_client.w3 | ||
|
||
@abstractmethod | ||
def get_contract_fn(self) -> Callable[[Web3, Optional[ChecksumAddress]], Contract]: | ||
""" | ||
:return: Contract function to get the proper contract | ||
""" | ||
raise NotImplementedError | ||
|
||
@cached_property | ||
def contract(self) -> Contract: | ||
return self.get_contract_fn()(self.ethereum_client.w3, self.address) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.