Skip to content

Commit

Permalink
Merge pull request #858 from lidofinance/feat/sr-1.5-develop-sync
Browse files Browse the repository at this point in the history
chore: Sync SR1.5 branch with the latest develop
  • Loading branch information
krogla authored Nov 26, 2024
2 parents 737b675 + 9c0bc19 commit 957fd2f
Show file tree
Hide file tree
Showing 302 changed files with 14,044 additions and 9,085 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

[*.{js,yml,json,cjs,ts}]
indent_size = 2

[*.sol]
indent_size = 4
63 changes: 63 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# RPC URL for a locally running node (Ganache, Anvil, Hardhat Network, etc.), used for scratch deployment and tests
LOCAL_RPC_URL=http://localhost:8555

LOCAL_LOCATOR_ADDRESS=
LOCAL_AGENT_ADDRESS=
LOCAL_VOTING_ADDRESS=
LOCAL_EASY_TRACK_EXECUTOR_ADDRESS=
LOCAL_ACCOUNTING_ORACLE_ADDRESS=
LOCAL_ACL_ADDRESS=
LOCAL_BURNER_ADDRESS=
LOCAL_DEPOSIT_SECURITY_MODULE_ADDRESS=
LOCAL_EL_REWARDS_VAULT_ADDRESS=
LOCAL_HASH_CONSENSUS_ADDRESS=
LOCAL_KERNEL_ADDRESS=
LOCAL_LEGACY_ORACLE_ADDRESS=
LOCAL_LIDO_ADDRESS=
LOCAL_NOR_ADDRESS=
LOCAL_ORACLE_DAEMON_CONFIG_ADDRESS=
LOCAL_ORACLE_REPORT_SANITY_CHECKER_ADDRESS=
LOCAL_SDVT_ADDRESS=
LOCAL_STAKING_ROUTER_ADDRESS=
LOCAL_VALIDATORS_EXIT_BUS_ORACLE_ADDRESS=
LOCAL_WITHDRAWAL_QUEUE_ADDRESS=
LOCAL_WITHDRAWAL_VAULT_ADDRESS=

# RPC URL for a separate, non Hardhat Network node (Anvil, Infura, Alchemy, etc.)
MAINNET_RPC_URL=http://localhost:8545

# RPC URL for Hardhat Network forking, required for running tests on mainnet fork with tracing (Infura, Alchemy, etc.)
# https://hardhat.org/hardhat-network/docs/guides/forking-other-networks#forking-other-networks
HARDHAT_FORKING_URL=

# https://docs.lido.fi/deployed-contracts
MAINNET_LOCATOR_ADDRESS=0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb
MAINNET_AGENT_ADDRESS=0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c
MAINNET_VOTING_ADDRESS=0x2e59A20f205bB85a89C53f1936454680651E618e
MAINNET_EASY_TRACK_EXECUTOR_ADDRESS=0xFE5986E06210aC1eCC1aDCafc0cc7f8D63B3F977
MAINNET_ACCOUNTING_ORACLE_ADDRESS=
MAINNET_ACL_ADDRESS=
MAINNET_BURNER_ADDRESS=
MAINNET_DEPOSIT_SECURITY_MODULE_ADDRESS=
MAINNET_EL_REWARDS_VAULT_ADDRESS=
MAINNET_HASH_CONSENSUS_ADDRESS=
MAINNET_KERNEL_ADDRESS=
MAINNET_LEGACY_ORACLE_ADDRESS=
MAINNET_LIDO_ADDRESS=
MAINNET_NOR_ADDRESS=
MAINNET_ORACLE_DAEMON_CONFIG_ADDRESS=
MAINNET_ORACLE_REPORT_SANITY_CHECKER_ADDRESS=
MAINNET_SDVT_ADDRESS=
MAINNET_STAKING_ROUTER_ADDRESS=
MAINNET_VALIDATORS_EXIT_BUS_ORACLE_ADDRESS=
MAINNET_WITHDRAWAL_QUEUE_ADDRESS=
MAINNET_WITHDRAWAL_VAULT_ADDRESS=

# Scratch deployment via hardhat variables
DEPLOYER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
GENESIS_TIME=1639659600
GAS_PRIORITY_FEE=1
GAS_MAX_FEE=100

# Etherscan API key for verifying contracts
ETHERSCAN_API_KEY=
38 changes: 0 additions & 38 deletions .eslintrc

This file was deleted.

7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CODEOWNERS: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# Any PR to `master` branch with changes to production contracts notifies the protocol team
/contracts/ @lidofinance/lido-eth-protocol

# Any PR to `master` branch with changes to GitHub workflows notifies the workflow review team
/.github/workflows/ @lidofinance/review-gh-workflows
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/CONTRACT-BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Contract Bug Report
description: File a bug report in a contract.
title: "[Bug]: "
labels: ["bug", "contracts"]
body:
- type: markdown
attributes:
value: |
⚠️ Important! If the bug may potentially lead to loss of user funds, denial of service, governance hijacks, data breaches, and data leaks, please refer to [Lido Bug Bounty](https://immunefi.com/bug-bounty/lido/information/).
- type: textarea
id: summary
attributes:
label: Summary
description: Short summary of the bug
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
description: Expected behavior of the contract without the bug
validations:
required: true
- type: textarea
id: Impact
attributes:
label: Potential Impact
description: Bug's impact and possible consequences
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to Reproduce
description: Instructions to reproduce the bug
validations:
required: true
- type: textarea
id: solution
attributes:
label: Possible Solutions
description: Possible ways to fix the bug
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Guidelines
options:
- label: I agree to follow [Code of Conduct](https://github.com/lidofinance/core/blob/master/CODE_OF_CONDUCT.md).
required: true
- label: I have read [Lido Contribution Guide](https://github.com/lidofinance/core/blob/master/CONTRIBUTING.md).
required: true
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Feature Request
description: Submit a feature request.
title: "[Feature Request]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request form!
- type: textarea
id: summary
attributes:
label: Summary
description: Short summary of the feature
validations:
required: true
- type: textarea
id: problem
attributes:
label: Problem
description: Existing problem that the feature solves
validations:
required: true
- type: textarea
id: implementation
attributes:
label: Implementation
description: Possible ways to implement this feature
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Guidelines
options:
- label: I agree to follow [Code of Conduct](https://github.com/lidofinance/core/blob/master/CODE_OF_CONDUCT.md).
required: true
- label: I have read [Lido Contribution Guide](https://github.com/lidofinance/core/blob/master/CONTRIBUTING.md).
required: true
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
A short summary of the changes.

## Context

What the reviewer needs to know

## Problem

What problem this PR solves, link relevant issue if it exists

## Solution

Your proposed solution
48 changes: 17 additions & 31 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: Code Analysis
name: Analysis

on:
push:
branches: [ master, develop, repovation ]
pull_request:
branches: [ master, develop, repovation ]
on: [pull_request]

jobs:
slither:
name: Solidity code analysis
name: Slither
runs-on: ubuntu-latest

permissions:
Expand All @@ -17,30 +13,12 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- run: corepack enable

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"

- name: Install dependencies
run: yarn install
- name: Common setup
uses: ./.github/workflows/setup

# REVIEW: here and below steps taken from official guide
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
- name: Install poetry
run: >
pipx install poetry
# REVIEW:
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-adding-a-system-path
- name: Add poetry to $GITHUB_PATH
run: >
echo "$HOME/.local/bin" >> $GITHUB_PATH
run: pipx install poetry

- uses: actions/setup-python@v5
with:
Expand All @@ -50,12 +28,20 @@ jobs:
- name: Install dependencies
run: poetry install --no-root

- name: Remove foundry.toml
run: rm -f foundry.toml
- name: Versions
run: >
poetry --version &&
python --version &&
echo "slither $(poetry run slither --version)" &&
poetry run slitherin --version
- name: Run slither
run: >
poetry run slither . --sarif results.sarif --no-fail-pedantic
poetry run slither . \
--no-fail-pedantic \
--compile-force-framework hardhat \
--sarif results.sarif \
--exclude pess-strange-setter,pess-arbitrary-call-calldata-tainted
- name: Check results.sarif presence
id: results
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
name: Coverage

on:
push:
branches: [ master, develop, repovation ]
pull_request:
branches: [ master, develop, repovation ]
on: [pull_request]

jobs:
coverage:
name: Solidity coverage
name: Hardhat
runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- run: corepack enable

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"
- name: Common setup
uses: ./.github/workflows/setup

- name: Install dependencies
run: yarn install
# Remove the integration tests from the test suite, as they require a mainnet fork to run properly
- name: Remove integration tests
run: rm -rf test/integration

- name: Run Solidity coverage
- name: Collect coverage
run: yarn test:coverage

- name: Produce the coverage report
uses: insightsengineering/coverage-action@v2
with:
path: ./coverage/cobertura-coverage.xml
publish: true
threshold: 95
diff: true
diff-branch: master
diff-storage: _core_coverage_reports
coverage-summary-title: "Code Coverage Summary"
coverage-summary-title: "Hardhat Unit Tests Coverage Summary"
togglable-report: true
Loading

0 comments on commit 957fd2f

Please sign in to comment.