-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdeploy_and_setup_crypto_ng_handler.py
47 lines (36 loc) · 1.24 KB
/
deploy_and_setup_crypto_ng_handler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# flake8: noqa
import os
import sys
import boa
from boa.network import NetworkEnv
from eth_account import Account
from rich import console as rich_console
sys.path.append("./")
from scripts.deploy_addressprovider_and_setup import fetch_url
from scripts.utils.constants import FIDDY_DEPLOYER
def main(network: str = "ethereum", fork: bool = True):
console = rich_console.Console()
if not fork:
# Prodmode
console.log("Running script in prod mode...")
boa.set_env(NetworkEnv(fetch_url(network)))
boa.env.add_account(Account.from_key(os.environ["FIDDYDEPLOYER"]))
else:
# Forkmode
console.log("Simulation Mode. Writing to mainnet-fork.")
boa.env.fork(url=fetch_url(network))
boa.env.eoa = FIDDY_DEPLOYER
# deploy handlers:
registry = boa.load(
"contracts/registry_handlers/ng/CurveTwocryptoFactoryHandler.vy",
"0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F",
)
registry = boa.load(
"contracts/registry_handlers/ng/CurveTricryptoFactoryHandler.vy",
"0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963",
)
console.log(f"Deployed Factory Handlers.")
if __name__ == "__main__":
network = "ethereum"
fork = False
main(network, fork)