Skip to content

Commit

Permalink
Merge pull request #39 from sanbir/eip-7251
Browse files Browse the repository at this point in the history
Eip 7251
  • Loading branch information
sanbir authored Jun 14, 2024
2 parents 58bb08d + 0cfc227 commit a0e88fa
Show file tree
Hide file tree
Showing 75 changed files with 10,693 additions and 11,407 deletions.
30 changes: 30 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,33 @@ feba
baf
dac
cooldown
adfdd
aec
Aee
aeef
afee
bcca
bea
cba
Cbb
CBef
ccd
cefd
cfcba
cfcf
dbd
dbf
dcd
dfaf
dfcbec
dfe
eaa
eba
ebe
ece
fbfedc
fcc
fdbdc
hardfork
holesky
Pectra
1 change: 1 addition & 0 deletions .github/actions/spelling/excludes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(?:^|/)go\.sum$
(?:^|/)package(?:-lock|)\.json$
(?:^|/)vendor/
(?:^|/)lib/
\.ai$
\.avi$
\.bmp$
Expand Down
2 changes: 1 addition & 1 deletion .nvm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
20.14.0
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ coverage
.env
.*
README.md
coverage.json
coverage.json
contracts
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-include .env

clean :; forge clean

build:; forge build

test :; forge test

snapshot :; forge snapshot

format :; forge fmt

NETWORK_ARGS := --rpc-url $(RPC_URL) --private-key $(PRIVATE_KEY) --broadcast --verify --etherscan-api-key $(ETHERSCAN_API_KEY) -vvvvv

deploy:
@forge script script/Deploy.s.sol:Deploy $(NETWORK_ARGS)
6 changes: 0 additions & 6 deletions P2pEth2Depositor_arguments.js

This file was deleted.

2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/interfaces/IERC1155.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../token/ERC1155/IERC1155.sol";
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/interfaces/IERC165.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../utils/introspection/IERC165.sol";
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/interfaces/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../token/ERC20/IERC20.sol";
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/interfaces/IERC721.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../token/ERC721/IERC721.sol";
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/proxy/Clones.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/Clones.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev Contract module that helps prevent reentrant calls to a function.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../../utils/introspection/IERC165.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev Interface of the ERC20 standard as defined in the EIP.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/token/ERC721/IERC721.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../../utils/introspection/IERC165.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/utils/Address.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev Collection of functions related to the address type
Expand Down
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/utils/Context.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev Provides information about the current execution context, including the
Expand Down
2 changes: 1 addition & 1 deletion contracts/@openzeppelin/contracts/utils/Strings.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev String operations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../Strings.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev These functions deal with verification of Merkle Tree proofs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./IERC165.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.2) (utils/introspection/ERC165Checker.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./IERC165.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev Interface of the ERC165 standard, as defined in the
Expand Down
4 changes: 2 additions & 2 deletions contracts/access/IOwnable.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* @dev External interface of Ownable.
Expand Down
4 changes: 2 additions & 2 deletions contracts/access/IOwnableWithOperator.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./IOwnable.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/access/Ownable.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>, OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>, OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./OwnableBase.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/access/Ownable2Step.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>, OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>, OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./Ownable.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/access/OwnableBase.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "../@openzeppelin/contracts/utils/Context.sol";
import "./IOwnable.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/access/OwnableWithOperator.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./Ownable2Step.sol";
import "./IOwnableWithOperator.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/assetRecovering/AssetRecoverer.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-License-Identifier: MIT

// https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol
pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./TokenRecoverer.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/assetRecovering/OwnableAssetRecoverer.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-License-Identifier: MIT

// https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol
pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./OwnableTokenRecoverer.sol";
import "./AssetRecoverer.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/assetRecovering/OwnableTokenRecoverer.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-License-Identifier: MIT

// https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol
pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./TokenRecoverer.sol";
import "../access/OwnableBase.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/assetRecovering/TokenRecoverer.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>, Lido <info@lido.fi>
// SPDX-License-Identifier: MIT

// https://github.com/lidofinance/lido-otc-seller/blob/master/contracts/lib/AssetRecoverer.sol
pragma solidity 0.8.10;
pragma solidity 0.8.24;

import {IERC20} from "../@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "../@openzeppelin/contracts/token/ERC721/IERC721.sol";
Expand Down
11 changes: 7 additions & 4 deletions contracts/constants/P2pConstants.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

/// @dev Maximal number of ETH2 deposits within a single transaction
/// @dev 400 deposits (12800 ETH) is determined by calldata size limit of 128 kb
/// https://ethereum.stackexchange.com/questions/144120/maximum-calldata-size-per-block
uint256 constant VALIDATORS_MAX_AMOUNT = 400;

/// @dev Collateral size of 1 validator
uint256 constant COLLATERAL = 32 ether;
/// @dev EIP-7251 MIN_ACTIVATION_BALANCE
uint96 constant MIN_ACTIVATION_BALANCE = 32 ether;

/// @dev EIP-7251 MAX_EFFECTIVE_BALANCE
uint96 constant MAX_EFFECTIVE_BALANCE = 2048 ether;

/// @dev Minimal 1 time deposit
uint256 constant MIN_DEPOSIT = 1 ether;
Expand Down
2 changes: 1 addition & 1 deletion contracts/erc4337/IAccount.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
pragma solidity 0.8.24;

import "./UserOperation.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/erc4337/IEntryPointStakeManager.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2023 P2P Validator <info@p2p.org>
// SPDX-FileCopyrightText: 2024 P2P Validator <info@p2p.org>
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;
pragma solidity 0.8.24;

interface IEntryPointStakeManager {

Expand Down
2 changes: 1 addition & 1 deletion contracts/erc4337/UserOperation.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
pragma solidity 0.8.24;

/**
* User Operation struct
Expand Down
Loading

0 comments on commit a0e88fa

Please sign in to comment.