Skip to content

Commit

Permalink
add boa scripts and remove ape script
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Nov 1, 2023
1 parent fd22952 commit 61f497f
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 251 deletions.
188 changes: 0 additions & 188 deletions scripts/deploy.py

This file was deleted.

132 changes: 128 additions & 4 deletions scripts/deploy_pool.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,144 @@
import os
import sys
from dataclasses import dataclass
from typing import List

import boa
from boa.network import NetworkEnv
from deploy_infra import deployments
from deployment_utils import pool_settings
from eth_account import Account
from eth_typing import Address
from rich.console import Console as RichConsole

logger = RichConsole(file=sys.stdout)
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"

deployments = {
# Ethereum
"ethereum:sepolia": {
"factory": "0xfb37b8D939FFa77114005e61CFc2e543d6F49A81",
},
"ethereum:mainnet": {
"factory": "0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf",
},
# Layer 2
"arbitrum:mainnet": {
"factory": "0x9AF14D26075f142eb3F292D5065EB3faa646167b",
},
"optimism:mainnet": {
"factory": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E",
},
"base:mainnet": {
"factory": "0xd2002373543Ce3527023C75e7518C274A51ce712",
},
"linea:mainnet": {
"factory": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E",
},
"scroll:mainnet": {
"factory": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E",
},
"zksync:mainnet": {
"factory": "",
},
"pzkevm:mainnet": {
"factory": "0xd2002373543Ce3527023C75e7518C274A51ce712",
},
"mantle:mainnet": {"factory": ""},
# Layer 1
"gnosis:mainnet": {
"factory": "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8",
},
"polygon:mainnet": {
"factory": "0x1764ee18e8B3ccA4787249Ceb249356192594585",
},
"avax:mainnet": {
"factory": "0x1764ee18e8B3ccA4787249Ceb249356192594585",
},
"ftm:mainnet": {
"factory": "0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b",
},
"bsc:mainnet": {
"factory": "0xd7E72f3615aa65b92A4DBdC211E296a35512988B",
},
"celo:mainnet": {
"factory": "0x1764ee18e8B3ccA4787249Ceb249356192594585",
},
"kava:mainnet": {
"factory": "0x1764ee18e8B3ccA4787249Ceb249356192594585",
},
"aurora:mainnet": {
"factory": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E",
},
"tron:mainnet": {
"factory": "",
},
}

def deploy_pool(network, url, account, fork, pool_type):

# -------------------------- POOL SETUP --------------------------


@dataclass
class PoolSettings:
name: str
symbol: str
coins: List[Address]
A: int
fee: int
offpeg_fee_multiplier: int
ma_exp_time: int
implementation_idx: int
asset_types: List[int]
method_ids: List[int]
oracles: List[Address]


pool_settings = {
"gnosis:mainnet": {
"plain": [
"WXDAI/USDC/USDT", # name
"3pool-ng", # symbol
[
"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d", # wxdai
"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83", # usdc
"0x4ECaBa5870353805a9F068101A40E0f32ed605C6", # usdt
],
1000, # A
1000000, # fee
20000000000, # offpeg_fee_multiplier
865, # ma_exp_time
0, # implementation index
[0, 0, 0], # asset_types
[b"", b"", b""], # method_ids
[ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS], # oracles
],
"meta": [
"0x7f90122bf0700f9e7e1f688fe926940e8839f353", # base_pool
"EURE/3CRV", # name
"eure3crvng", # symbol
"0xcb444e90d8198415266c6a2724b7900fb12fc56e", # eure
500, # A
1000000, # fee
20000000000, # offpeg_fee_multiplier
865, # ma_exp_time
0, # implementation index
0, # asset_types
b"", # method_ids
ZERO_ADDRESS, # oracles
],
}
}


def deploy_pool(network, url, account, pool_type, fork):

logger.log(f"Deploying pool on {network} ...")

if fork:
boa.env.fork(url)
logger.log("Forkmode ...")
boa.env.eoa = "" # set eoa address here
else:
logger.log("Prodmode ...")
boa.set_env(NetworkEnv(url))
boa.env.add_account(Account.from_key(os.environ[account]))

Expand All @@ -33,7 +156,8 @@ def deploy_pool(network, url, account, fork, pool_type):


def main():
deploy_pool("gnosis:mainnet", "https://gnosis.drpc.org", "FIDDYDEPLOYER", False, "meta") # forkmode
fork = True
deploy_pool("gnosis:mainnet", "https://gnosis.drpc.org", "FIDDYDEPLOYER", "meta", fork)


if __name__ == "__main__":
Expand Down
7 changes: 4 additions & 3 deletions scripts/deploy_proxy_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def deploy_proxy_admin(network, url, account, fork=False):
if fork:
boa.env.fork(url)
logger.log("Forkmode ...")
boa.env.eoa = deploy_utils.FIDDYDEPLOYER
else:
logger.log("Prodmode ...")
boa.set_env(NetworkEnv(url))
Expand All @@ -35,10 +36,10 @@ def deploy_proxy_admin(network, url, account, fork=False):

def main():
deploy_proxy_admin(
"pzkevm:mainnet",
os.environ["RPC_PZKEVM"],
"mantle:mainnet",
os.environ["RPC_MANTLE"],
"FIDDYDEPLOYER",
fork=False,
fork=True,
)


Expand Down
Loading

0 comments on commit 61f497f

Please sign in to comment.