Skip to content

Commit

Permalink
Merge pull request #89 from lidofinance/develop
Browse files Browse the repository at this point in the history
Weekly Repovation PR
  • Loading branch information
mymphe authored May 21, 2024
2 parents 65d6c6d + e03da3a commit 297b530
Show file tree
Hide file tree
Showing 91 changed files with 6,415 additions and 1,383 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-54d8510c0f2b0f791f4c5ef99866c6af99b7606a

- run: corepack enable

Expand All @@ -48,4 +50,4 @@ jobs:
run: yarn install

- name: Run tests
run: forge test --gas-report
run: forge test -vvv
20 changes: 17 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,23 @@ If you have a bigger idea on how to improve the protocol, consider publishing yo

### Requirements

- [Node.js v20](https://nodejs.org/en)
- [Yarn](https://yarnpkg.com/)
- [Foundry](https://book.getfoundry.sh/)
- [Node.js](https://nodejs.org/en) version 20 (LTS) with `corepack` enabled
- [Yarn](https://yarnpkg.com/) installed via corepack (see below)
- [Foundry](https://book.getfoundry.sh/) latest available version

> [!NOTE]
> On macOS with Homebrew it is recommended to install Node.js using [`n`](https://github.com/tj/n) or [`nvm`](https://github.com/nvm-sh/nvm) version managers.
> Example setup process using `n` package manager for zsh users:
>
> ```
> $ brew install n
> $ echo "\n\nexport N_PREFIX=\$HOME/.local\nexport PATH=\$N_PREFIX/bin:\$PATH" >> ~/.zshrc
> $ source ~/.zshrc
> $ n lts
> $ corepack enable
> $ cd /path/to/core
> $ yarn
> ```
### Setup

Expand Down
105 changes: 0 additions & 105 deletions contracts/0.4.24/test_helpers/StakeLimitUtilsMock.sol

This file was deleted.

57 changes: 0 additions & 57 deletions contracts/0.8.9/test_helpers/PositiveTokenRebaseLimiterMock.sol

This file was deleted.

2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { globSync } from "glob";
import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/task-names";
import { HardhatUserConfig, subtask } from "hardhat/config";

import { mochaRootHooks } from "./test/setup";
import { mochaRootHooks } from "test/hooks";

const RPC_URL: string = process.env.RPC_URL || "";
const HARDHAT_FORKING_URL = process.env.HARDHAT_FORKING_URL || "";
Expand Down
2 changes: 1 addition & 1 deletion lib/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ethers } from "hardhat";

import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers";

import { getNetworkName } from "./client";
import { getNetworkName } from "./network";

export async function impersonate(address: string, balance?: bigint): Promise<HardhatEthersSigner> {
const networkName = await getNetworkName();
Expand Down
12 changes: 8 additions & 4 deletions lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export const MAX_UINT256 = 2n ** 256n - 1n;
export const INITIAL_STETH_HOLDER = "0x000000000000000000000000000000000000dEaD";

// https://eips.ethereum.org/EIPS/eip-165

// bytes4(keccak256('supportsInterface(bytes4)'))
export const ERC165_INTERFACE_ID = "0x01ffc9a7";

Expand All @@ -22,11 +21,14 @@ export const INVALID_INTERFACE_ID = "0xffffffff";

// Chain related
export const SECONDS_PER_SLOT = 12n;
export const EPOCHS_PER_FRAME = 225; // one day;
export const EPOCHS_PER_FRAME = 225n; // one day;

// Oracle report related
export const SLOTS_PER_EPOCH = 32;
export const CONSENSUS_VERSION = 1;
export const GENESIS_TIME = 100n;
export const SLOTS_PER_EPOCH = 32n;
export const CONSENSUS_VERSION = 1n;
export const INITIAL_EPOCH = 1n;
export const INITIAL_FAST_LANE_LENGTH_SLOTS = 0n;

// Default admin role for AccessControl compatible contracts
export const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000";
Expand All @@ -47,3 +49,5 @@ export const PUBKEY_LENGTH_HEX = PUBKEY_LENGTH * 2;
export const SIGNATURE_LENGTH_HEX = SIGNATURE_LENGTH * 2;
export const EMPTY_PUBLIC_KEY = "0x".padEnd(PUBKEY_LENGTH_HEX + 2, "0");
export const EMPTY_SIGNATURE = "0x".padEnd(SIGNATURE_LENGTH_HEX + 2, "0");

export const ONE_GWEI = 1_000_000_000n;
35 changes: 0 additions & 35 deletions lib/dummy.ts

This file was deleted.

6 changes: 1 addition & 5 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
export * from "./account";
export * from "./address";
export * from "./aragon";
export * from "./client";
export * from "./constants";
export * from "./contract";
export * from "./deploy";
export * from "./dsm";
export * from "./dummy";
export * from "./ec";
export * from "./eip712";
export * from "./ens";
export * from "./event";
export * from "./keccak";
export * from "./log";
export * from "./network";
export * from "./oracle";
export * from "./promise";
export * from "./proxy";
export * from "./signing-keys";
export * from "./snapshot";
export * from "./state-file";
export * from "./string";
export * from "./time";
export * from "./type";
export * from "./units";
export * from "./withdrawal";
File renamed without changes.
Loading

0 comments on commit 297b530

Please sign in to comment.