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

Add ecMulG2 precompile #220

Merged
merged 5 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .test-node-subtree/scripts/refresh_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for contract in "${contracts[@]}"; do
cp $SRC_DIR/$contract.sol/$contract.json $DST_DIR
done

precompiles=("EcAdd" "EcMul" "EcPairing" "Ecrecover" "Keccak256" "ModExp" "P256VERIFY" "SHA256" "secp256k1VERIFY")
precompiles=("EcAdd" "EcMul" "EcPairing" "Ecrecover" "Keccak256" "ModExp" "P256VERIFY" "SHA256" "secp256k1VERIFY" "EcMulG2")

for precompile in "${precompiles[@]}"; do
cp etc/system-contracts/contracts/precompiles/artifacts/$precompile.yul/$precompile.yul.zbin $DST_DIR
Expand Down
11 changes: 11 additions & 0 deletions .test-node-subtree/src/deps/system_contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ pub const ECMUL_PRECOMPILE_ADDRESS: Address = H160([
0x00, 0x00, 0x00, 0x07,
]);

/// The `ecMulG2` system contract address.
pub const ECMUL_G2_PRECOMPILE_ADDRESS: Address = H160([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0B,
]);

/// The `ecPairing` system contract address.
pub const ECPAIRING_PRECOMPILE_ADDRESS: Address = H160([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -155,6 +161,11 @@ pub static COMPILED_IN_SYSTEM_CONTRACTS: Lazy<Vec<DeployedContract>> = Lazy::new
ECMUL_PRECOMPILE_ADDRESS,
include_bytes!("contracts/EcMul.yul.zbin").to_vec(),
),
(
"ECMUL_G2_PRECOMPILE_ADDRESS",
ECMUL_G2_PRECOMPILE_ADDRESS,
include_bytes!("contracts/EcMulG2.yul.zbin").to_vec(),
),
(
"ECPAIRING_PRECOMPILE_ADDRESS",
ECPAIRING_PRECOMPILE_ADDRESS,
Expand Down
Loading
Loading