From 583b416fe8c38bdb88f8f956f1f037c806d6d4c3 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Sun, 9 Nov 2025 20:50:41 +0100 Subject: [PATCH] Improve precompiles page --- docs/background/precompiles.md | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/background/precompiles.md b/docs/background/precompiles.md index e1a5dd19fa..0ec4a76a86 100644 --- a/docs/background/precompiles.md +++ b/docs/background/precompiles.md @@ -37,27 +37,27 @@ convention. The `pallet-revive` ships with a number of precompiles that are enabled by default: -| Name | Address | Called via | Enabled by default? | Implemented in ink!? | -|----------------------------------------------------------------------------------------------------------------------------------|---------|--------------------|---------------------|----------------------| -| [EcRecover](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/ecrecover.rs) | 0x1 | Raw bytes | ✅ | ✅| -| [Sha256](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/sha256.rs) | 0x2 | Raw bytes | ✅ | ✅| -| [Ripemd160](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/ripemd160.rs) | 0x3 | Raw bytes | ✅ | Not yet | -| [Identity](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/identity.rs) | 0x4 | Raw bytes | ✅ | Not yet | -| [Modexp](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/modexp.rs) | 0x5 | Raw bytes | ✅ | Not yet | -| [Bn128Add](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/bn128.rs) | 0x6 | Raw bytes | ✅ | Not yet | -| [Bn128Mul](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/bn128.rs) | 0x7 | Raw bytes | ✅ | Not yet | -| [Bn128Pairing](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/bn128.rs) | 0x8 | Raw bytes | ✅ | Not yet | -| [Blake2F](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/blake2f.rs) | 0x9 | Raw bytes | ✅ | Not yet | -| [PointEval](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/point_eval.rs) | 0a | Raw bytes | ✅ | Not yet | -| [System](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/system.rs) | 0x900 | Solidity interface | ✅ | ✅| -| [Storage](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/storage.rs) | 0x901 | Solidity interface | ✅ | ✅| +| Name | Address | Called via | Enabled by default? | Implemented in ink!? | +|----------------------------------------------------------------------------------------------------------------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|---------------------|----------------------| +| [EcRecover](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/ecrecover.rs) | 0x1 | Raw bytes | ✅ | ✅| +| [Sha256](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/sha256.rs) | 0x2 | Raw bytes | ✅ | ✅| +| [Ripemd160](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/ripemd160.rs) | 0x3 | Raw bytes | ✅ | Not yet | +| [Identity](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/identity.rs) | 0x4 | Raw bytes | ✅ | Not yet | +| [Modexp](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/modexp.rs) | 0x5 | Raw bytes | ✅ | Not yet | +| [Bn128Add](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/bn128.rs) | 0x6 | Raw bytes | ✅ | Not yet | +| [Bn128Mul](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/bn128.rs) | 0x7 | Raw bytes | ✅ | Not yet | +| [Bn128Pairing](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/bn128.rs) | 0x8 | Raw bytes | ✅ | Not yet | +| [Blake2F](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/blake2f.rs) | 0x9 | Raw bytes | ✅ | Not yet | +| [PointEval](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/point_eval.rs) | 0a | Raw bytes | ✅ | Not yet | +| [System](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/system.rs) | 0x900 | [Solidity interface](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/uapi/src/precompiles/system.rs) | ✅ | ✅| +| [Storage](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/src/precompiles/builtin/storage.rs) | 0x901 | [Solidity interface](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/revive/uapi/src/precompiles/storage.rs) | ✅ | ✅| The Polkadot SDK contains a number of additional precompiles that can be enabled at will: -| Name | Address | Called via | Enabled by default? | Implemented in ink!? | -|----------------------------------------------------------------------------------------------------------------|---------|--------------------|---------------------|----------------------| -| [AssetsPrecompile](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/assets/precompiles) | 0x0120 | Solidity interface | ✅ | Not yet | -| [XcmPrecompile](https://github.com/paritytech/polkadot-sdk/tree/master/polkadot/xcm/pallet-xcm/precompiles/) | 0xA0000 | Raw bytes | ✅ | ✅ | +| Name | Address | Called via | Enabled by default? | Implemented in ink!? | +|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|---------------------|----------------------| +| [AssetsPrecompile](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/assets/precompiles) | [0x120, 0x320](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs#L1192-L1196) | [Solidity interface](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/primitives/ethereum-standards/src/IERC20.sol) | ✅ | Not yet | +| [XcmPrecompile](https://github.com/paritytech/polkadot-sdk/tree/master/polkadot/xcm/pallet-xcm/precompiles/) | 0xA0000 | Raw bytes | ✅ | ✅ | ## Add your own precompiles