forked from nucypher/nucypher-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relocates custom logic into 'deploymnets' package; Removes stale scri…
…pts that use legacy deployment methods
- Loading branch information
Showing
29 changed files
with
151 additions
and
609 deletions.
There are no files selected for viewing
Empty file.
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,36 @@ | ||
from collections import OrderedDict | ||
|
||
from deployment.constants import NULL_ADDRESS | ||
|
||
|
||
def _confirm_deployment(contract_name: str) -> None: | ||
"""Asks the user to confirm the deployment of a single contract.""" | ||
answer = input(f"Deploy {contract_name} Y/N? ") | ||
if answer.lower().strip() == "n": | ||
print("Aborting deployment!") | ||
exit(-1) | ||
|
||
|
||
def _confirm_null_address() -> None: | ||
answer = input("Null Address detected for deployment parameter; Continue? Y/N? ") | ||
if answer.lower().strip() == "n": | ||
print("Aborting deployment!") | ||
exit(-1) | ||
|
||
|
||
def _confirm_resolution(resolved_params: OrderedDict, contract_name: str) -> None: | ||
"""Asks the user to confirm the resolved constructor parameters for a single contract.""" | ||
if len(resolved_params) == 0: | ||
print(f"\n(i) No constructor parameters for {contract_name}") | ||
_confirm_deployment(contract_name) | ||
return | ||
|
||
print(f"\nConstructor parameters for {contract_name}") | ||
contains_null_address = False | ||
for name, resolved_value in resolved_params.items(): | ||
print(f"\t{name}={resolved_value}") | ||
if not contains_null_address: | ||
contains_null_address = resolved_value == NULL_ADDRESS | ||
_confirm_deployment(contract_name) | ||
if contains_null_address: | ||
_confirm_null_address() |
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,20 @@ | ||
from pathlib import Path | ||
|
||
from ape import networks, project | ||
|
||
import deployment | ||
|
||
LOCAL_BLOCKCHAIN_ENVIRONMENTS = ["local"] | ||
PRODUCTION_ENVIRONMENTS = ["mainnet", "polygon-main"] | ||
CURRENT_NETWORK = networks.network.name | ||
DEPLOYMENT_DIR = Path(deployment.__file__).parent | ||
CONSTRUCTOR_PARAMS_DIR = DEPLOYMENT_DIR / "constructor_params" | ||
ARTIFACTS_DIR = DEPLOYMENT_DIR / "artifacts" | ||
ETHERSCAN_API_KEY_ENVVAR = "ETHERSCAN_API_KEY" | ||
WEB3_INFURA_API_KEY_ENVVAR = "WEB3_INFURA_API_KEY" | ||
NULL_ADDRESS = "0x" + "0" * 40 | ||
VARIABLE_PREFIX = "$" | ||
PROXY_DECLARATION_DELIMETER = ":" | ||
SPECIAL_VALUE_VARIABLES = {"EMPTY_BYTES": b""} | ||
PROXY_NAME = "TransparentUpgradeableProxy" | ||
OZ_DEPENDENCY = project.dependencies["openzeppelin"]["4.9.1"] |
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.