forked from NethermindEth/nethermind
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEthereumPrecompileProvider.cs
More file actions
52 lines (42 loc) · 2.14 KB
/
Copy pathEthereumPrecompileProvider.cs
File metadata and controls
52 lines (42 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only
using System.Collections.Frozen;
using System.Collections.Generic;
using Nethermind.Core;
using Nethermind.Evm;
using Nethermind.Evm.CodeAnalysis;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls;
namespace Nethermind.Blockchain;
public class EthereumPrecompileProvider() : IPrecompileProvider
{
private static FrozenDictionary<AddressAsKey, CodeInfo> Precompiles
{
get => new Dictionary<AddressAsKey, CodeInfo>
{
[EcRecoverPrecompile.Address] = new(EcRecoverPrecompile.Instance),
[Sha256Precompile.Address] = new(Sha256Precompile.Instance),
[Ripemd160Precompile.Address] = new(Ripemd160Precompile.Instance),
[IdentityPrecompile.Address] = new(IdentityPrecompile.Instance),
[BN254AddPrecompile.Address] = new(BN254AddPrecompile.Instance),
[BN254MulPrecompile.Address] = new(BN254MulPrecompile.Instance),
[BN254PairingPrecompile.Address] = new(BN254PairingPrecompile.Instance),
[ModExpPrecompile.Address] = new(ModExpPrecompile.Instance),
[Blake2FPrecompile.Address] = new(Blake2FPrecompile.Instance),
[G1AddPrecompile.Address] = new(G1AddPrecompile.Instance),
[G1MSMPrecompile.Address] = new(G1MSMPrecompile.Instance),
[G2AddPrecompile.Address] = new(G2AddPrecompile.Instance),
[G2MSMPrecompile.Address] = new(G2MSMPrecompile.Instance),
[PairingCheckPrecompile.Address] = new(PairingCheckPrecompile.Instance),
[MapFpToG1Precompile.Address] = new(MapFpToG1Precompile.Instance),
[MapFp2ToG2Precompile.Address] = new(MapFp2ToG2Precompile.Instance),
[PointEvaluationPrecompile.Address] = new(PointEvaluationPrecompile.Instance),
[Secp256r1Precompile.Address] = new(Secp256r1Precompile.Instance),
[L1SloadPrecompile.Address] = new(L1SloadPrecompile.Instance),
}.ToFrozenDictionary();
}
public FrozenDictionary<AddressAsKey, CodeInfo> GetPrecompiles()
{
return Precompiles;
}
}