Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Sepolia support #208

Merged
merged 10 commits into from
Apr 24, 2024
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ pipx install poetry==1.5.0
Ensure that poetry bin path is added to your `$PATH` env variable.
Usually it's `$HOME/.local/bin` for most Unix-like systems.

This is a workaround related `brownie` deps `pyyaml` issue https://github.com/eth-brownie/brownie/issues/1701
This is a workaround related `brownie` deps `pyyaml` issue <https://github.com/eth-brownie/brownie/issues/1701>

```shell
poetry run pip install "cython<3.0" pyyaml==5.4.1 --no-build-isolation
```
Expand Down Expand Up @@ -85,21 +86,29 @@ poetry shell
### Network setup

By default, you should start composing new scripts and test using forked networks.
You have two forked networks to work with:
You have three forked networks to work with:

- `mainnet-fork`
- `goerli-fork`
- `sepolia-fork`

To start new voting on the live networks you could proceed with:

- `mainnet`
- `goerli`
- `sepolia`

>Note: you can't run tests on the live networks.

In a typical weekly omnibus workflow, you need only `mainnet-fork` and
`mainnet` networks. In case of large test campaign on Lido upgrades,
it also could be useful to go with `goerli` and `goerli-fork` testnets first.
it also could be useful to go with `goerli`/`sepolia` and `goerli-fork`/`sepolia-fork` testnets first.

To connect to Sepolia testnet set the following var:

```bash
export SEPOLIA_RPC_URL=<sepolia_rpc_url>
```

### Environment variables setup

Expand Down Expand Up @@ -135,6 +144,7 @@ export WEB3_INFURA_IPFS_PROJECT_SECRET=<infura_project_secret>
# For WEB3
export WEB3_STORAGE_TOKEN=<web3_storage_api_key>
```

See [here](utils/README.md#ipfs) to learn more Markdown description

To skip events decoding while testing set the following var:
Expand Down
57 changes: 57 additions & 0 deletions configs/config_sepolia.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Use this config as address book only
CHAIN_NETWORK_NAME = "sepolia"
# DAO
ARAGON_KERNEL = "0x6155bD199ECcc79Ff4e8B392f6cBD9c9874E8916"
LDO_TOKEN = "0xd06dF83b8ad6D89C86a187fba4Eae918d497BdCB"
# Standard (or forked) Aragon apps
ACL = "0x8A1AA86d35b2EE8C9369618E7D7b40000cCD3295"
AGENT = "0x32A0E5828B62AAb932362a4816ae03b860b65e83"
FINANCE = "0x75c7b1D23f1cad7Fb4D60281d7069E46440BC179"
VOTING = "0x39A0EbdEE54cB319f4F42141daaBDb6ba25D341A"
TOKEN_MANAGER = "0xC73cd4B2A7c1CBC5BF046eB4A7019365558ABF66"
# Our custom Aragon apps
LIDO = "0x3e3FE7dBc6B4C189E7128855dD526361c49b40Af"
LIDO_LEGACY_ORACLE = "0x3483c140EF7F2716460198Ff831a8e53F05F1606"
LIDO_NODE_OPERATORS_REGISTRY = "0x33d6E15047E8644F8DDf5CD05d202dfE587DA6E3"
# Aragon APM Repos
VOTING_REPO = ""
LIDO_LIDO_REPO = ""
LIDO_NODE_OPERATORS_REGISTRY_REPO = ""
LIDO_LEGACY_ORACLE_REPO = ""

DEPOSIT_SECURITY_MODULE_V1 = "0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5"
LIDO_DEPOSIT_SECURITY_MODULE = "0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5"

DUMMY_IMPL = ""

LIDO_LOCATOR = "0x8f6254332f69557A72b0DA2D5F0Bc07d4CA991E7"
BURNER = "0x61Bb0Ef69262d5EF1cc2873cf61766751D99B699"
EXECUTION_LAYER_REWARDS_VAULT = "0x94B1B8e2680882f8652882e7F196169dE3d9a3B2"
HASH_CONSENSUS_FOR_AO = "0x758D8c3CE794b3Dfe3b3A3482B7eD33de2109D95"
ACCOUNTING_ORACLE = "0xd497Be005638efCf09F6BFC8DAFBBB0BB72cD991"
HASH_CONSENSUS_FOR_VEBO = "0x098a952BD200005382aEb3229e38ae39A7616F56"
LIDO_VALIDATORS_EXIT_BUS_ORACLE = "0x7637d44c9f2e9cA584a8B5D2EA493012A5cdaEB6"
ORACLE_REPORT_SANITY_CHECKER = "0xbac2A471443F18aC5C31078b96C5797A78fCc680"
LIDO_WITHDRAWAL_QUEUE = "0x1583C7b3f4C3B008720E6BcE5726336b0aB25fdd"
GATE_SEAL = ""
EIP712_STETH = "0x9726CA9AEFF4BC8FB8C084BdAbdB71608248E3f8"
WITHDRAWAL_VAULT = "0xDe7318Afa67eaD6d6bbC8224dfCe5ed6e4b86d76"
STAKING_ROUTER = "0x4F36aAEb18Ab56A4e380241bea6ebF215b9cb12c"
ORACLE_DAEMON_CONFIG = "0x7bC76076b0f3879b4A750450C0Ccf02c6Ca11220"

INSURANCE_FUND = ""
RELAY_ALLOWED_LIST = ""

LDO_HOLDER_ADDRESS_FOR_TESTS = "0x8360927B5BC431771C21E347eA29529b6eE94b78"
LDO_VOTE_EXECUTORS_FOR_TESTS = [
"0x32A0E5828B62AAb932362a4816ae03b860b65e83",
"0x8360927B5BC431771C21E347eA29529b6eE94b78",
"0xaa6bfBCD634EE744CB8FE522b29ADD23124593D3",
]

ORACLE_COMMITTEE = []

DSM_GUARDIANS = []

WSTETH_TOKEN = "0xB82381A3fBD3FaFA77B3a7bE693342618240067b"
CHAIN_DEPOSIT_CONTRACT = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"
31 changes: 31 additions & 0 deletions network-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
live:
- name: Ethereum
networks:
- chainid: 11155111
explorer: https://api-sepolia.etherscan.io/api
host: $SEPOLIA_RPC_URL
id: sepolia
# New backward-compatible multicall contract. multicall2 is missing on Holesky. See https://github.com/mds1/multicall
multicall2: "0xeAA373D1973e5af44e91840ee097bf7AD64693c2"
name: Sepolia (Infura)
provider: infura
development:

# Mainnet Fork
- cmd: ./ganache.sh
cmd_settings:
accounts: 10
Expand All @@ -12,6 +25,8 @@ development:
timeout: 360
# https://github.com/mds1/multicall#multicall2-contract-addresses
multicall2: "0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696"

# Goerli Fork
- cmd: ./ganache.sh
cmd_settings:
accounts: 10
Expand All @@ -24,6 +39,22 @@ development:
id: goerli-fork
name: goerli-fork
timeout: 360

# Sepolia Fork
- cmd: ./ganache.sh
cmd_settings:
accounts: 10
chain_id: 11155111
fork: $SEPOLIA_RPC_URL
gas_limit: 30000000
mnemonic: brownie
port: 8545
host: http://127.0.0.1
id: sepolia-fork
name: sepolia-fork
timeout: 360

# Local Fork
- cmd: ./ganache.sh
cmd_settings:
accounts: 10
Expand Down
23 changes: 20 additions & 3 deletions utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,24 @@ def network_name() -> Optional[str]:
if network_name() in ("goerli", "goerli-fork"):
print(f'Using {color("cyan")}config_goerli.py{color} addresses')
from configs.config_goerli import *
elif network_name() in ("sepolia", "sepolia-fork"):
print(f'Using {color("yellow")}config_sepolia.py{color} addresses')
from configs.config_sepolia import *
else:
print(f'Using {color("magenta")}config_mainnet.py{color} addresses')
from configs.config_mainnet import *


def get_is_live() -> bool:
dev_networks = ["development", "hardhat", "hardhat-fork", "goerli-fork", "local-fork", "mainnet-fork"]
dev_networks = [
"development",
"hardhat",
"hardhat-fork",
"goerli-fork",
"local-fork",
"mainnet-fork",
"sepolia-fork",
]
return network.show_active() not in dev_networks


Expand Down Expand Up @@ -87,8 +98,10 @@ def get_pinata_cloud_token(silent=False) -> str:

def get_infura_io_keys(silent=False) -> Tuple[str, str]:
is_live = get_is_live()
if is_live and not silent and (
"WEB3_INFURA_IPFS_PROJECT_ID" not in os.environ or "WEB3_INFURA_IPFS_PROJECT_SECRET" not in os.environ
if (
is_live
and not silent
and ("WEB3_INFURA_IPFS_PROJECT_ID" not in os.environ or "WEB3_INFURA_IPFS_PROJECT_SECRET" not in os.environ)
):
raise EnvironmentError(
"Please set WEB3_INFURA_IPFS_PROJECT_ID and WEB3_INFURA_IPFS_PROJECT_SECRET env variable "
Expand Down Expand Up @@ -120,6 +133,10 @@ def get_config_params() -> Dict[str, str]:
import configs.config_goerli

ret = {x: globals()[x] for x in dir(configs.config_goerli) if not x.startswith("__")}
elif network_name() in ("sepolia", "sepolia-fork"):
import configs.config_sepolia

ret = {x: globals()[x] for x in dir(configs.config_sepolia) if not x.startswith("__")}
else:
import configs.config_mainnet

Expand Down
13 changes: 7 additions & 6 deletions utils/voting.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,13 @@ def confirm_vote_script(

# Show detailed description of prepared voting.
if not silent:
human_readable_script = decode_evm_script(
encoded_call_script,
verbose=False,
specific_net=CHAIN_NETWORK_NAME,
repeat_is_error=True,
)
# human_readable_script = decode_evm_script(
# encoded_call_script,
# verbose=False,
# specific_net=CHAIN_NETWORK_NAME,
# repeat_is_error=True,
# )
human_readable_script = []

vote_descriptions = list(vote_items.keys())

Expand Down
Loading