### Install Go Snappy Library
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-706.md
Install the Go Snappy library for use in the decompression verification tool. This is a prerequisite for running the Go decompression example.
```sh
$ go get https://github.com/golang/snappy
```
--------------------------------
### Example Initialization Script
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1102.md
A JavaScript example demonstrating how to use `eth_requestAccounts` for dapp initialization.
```APIDOC
## Example Initialization Script
### Description
This script shows a practical implementation of requesting account access and handling potential errors.
### Code Example
```js
try {
// Request account access if needed
const accounts = await ethereum.send('eth_requestAccounts');
// Accounts now exposed, use them
ethereum.send('eth_sendTransaction', { from: accounts[0], /* ... */ })
} catch (error) {
// User denied account access or other error occurred
console.error("Error requesting accounts:", error);
}
```
```
--------------------------------
### EVM Example 3: Different Init Code
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1014.md
Demonstrates an example with a non-empty init_code.
```text
address `0x0000000000000000000000000000000000000000`
salt `0x0000000000000000000000000000000000000000000000000000000000000000`
init_code `0xdeadbeef`
gas (assuming no mem expansion): `32006`
result: `0x70f2b2914A2a4b783FaEFb75f459A580616Fcb5e`
```
--------------------------------
### EVM Example 6: Empty Init Code
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1014.md
Shows an example with an empty init_code.
```text
address `0x0000000000000000000000000000000000000000`
salt `0x0000000000000000000000000000000000000000000000000000000000000000`
init_code `0x`
gas (assuming no mem expansion): `32000`
result: `0xE33C0C7F7df4809055C3ebA6c09CFe4BaF1BD9e0`
```
--------------------------------
### EVM Example 0: Default Parameters
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1014.md
Demonstrates a basic example with default address, salt, and init_code.
```text
address `0x0000000000000000000000000000000000000000`
salt `0x0000000000000000000000000000000000000000000000000000000000000000`
init_code `0x00`
gas (assuming no mem expansion): `32006`
result: `0x4D1A2e2bB4F88F0250f26Ffff098B0b30B26BF38`
```
--------------------------------
### EVM Example 5: Long Init Code
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1014.md
Demonstrates an example with a longer init_code value.
```text
address `0x00000000000000000000000000000000deadbeef`
salt `0x00000000000000000000000000000000000000000000000000000000cafebabe`
init_code `0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
gas (assuming no mem expansion): `32012`
result: `0x1d8bfDC5D46DC4f61D6b6115972536eBE6A8854C`
```
--------------------------------
### Install NTT Project
Source: https://github.com/ethereum/eips/blob/master/assets/eip-7885/pythonref/README.md
Use this command to install the NTT project. Ensure you have the necessary build tools.
```bash
make install
```
--------------------------------
### Install and Run EIP Validator
Source: https://github.com/ethereum/eips/blob/master/README.md
Installs the EIP validator tool and provides an example command to run it on a file or directory. Ensure cargo's bin directory is in your PATH.
```sh
cargo install eipw
eipw --config ./config/eipw.toml
```
--------------------------------
### Install Python Snappy Library
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-706.md
Install the python-snappy library for use in the Python decompression verification script. This is a prerequisite for running the Python decompression example.
```bash
$ pip install python-snappy
```
--------------------------------
### EVM Example 1: Different Address
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1014.md
Shows an example with a different target address while keeping salt and init_code the same.
```text
address `0xdeadbeef00000000000000000000000000000000`
salt `0x0000000000000000000000000000000000000000000000000000000000000000`
init_code `0x00`
gas (assuming no mem expansion): `32006`
result: `0xB928f69Bb1D91Cd65274e3c79d8986362984fDA3`
```
--------------------------------
### EVM Example 2: Different Salt
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1014.md
Illustrates an example with a modified salt value.
```text
address `0xdeadbeef00000000000000000000000000000000`
salt `0x0000000000000000000000000000000000000000000000000000000000000000`
init_code `0x00`
gas (assuming no mem expansion): `32006`
result: `0xD04116cDd17beBE565EB2422F2497E06cC1C9833`
```
--------------------------------
### EVM Example 4: Custom Address and Salt
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1014.md
Shows an example with both a custom address and a custom salt.
```text
address `0x00000000000000000000000000000000deadbeef`
salt `0x00000000000000000000000000000000000000000000000000000000cafebabe`
init_code `0xdeadbeef`
gas (assuming no mem expansion): `32006`
result: `0x60f3f640a8508fC6a86d45DF051962668E1e8AC7`
```
--------------------------------
### Install liboqs and Go Bindings
Source: https://github.com/ethereum/eips/blob/master/assets/eip-7885/op-geth/cgo/README.md
Clone the liboqs repository, install system dependencies, and build the Go bindings for NTT CGO. Adjust paths as necessary.
```bash
git clone -b feature/ntt-cgo-bindings https://github.com/yhl125/liboqs.git
sudo apt install astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind pkg-config
cd liboqs/bindings/go
make all
```
--------------------------------
### Initial CALLPROC Frame Stack Example
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-4573.md
Illustrates the frame stack after an initial CALLPROC to a procedure requiring two words of data. FP starts at 0 and moves downwards.
```assembly
0-> ........
........
FP->
```
--------------------------------
### Get Uncle by Block Number and Index with Base Fee
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-3046.md
This example demonstrates how to request uncle information including the `baseFee` using `eth_getUncleByBlockNumberAndIndex`. The `baseFee` field is only present for blocks on or after the EIP-1559 fork.
```shell
# Request
curl -X POST --data '{
"id": 1559,
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockNumberAndIndex",
"params":["latest", "0x0"]
}'
# Response
{
"id": 1559,
"jsonrpc": "2.0",
"result": {
"difficulty": "0x027f07",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFee": "0x7"
"gasLimit": "0x9f759",
"gasUsed": "0x9f759",
"hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
"logsBloom": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
"miner": "0x4e65fda2159562a496f9f3522f89122a3088497a",
"nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2",
"number": "0x1b4",
"parentHash": "0x9646252be9520f6e71339a8df9c55e4d7619deeb018d2a3f2d21fc165dde5eb5",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x027f07",
"stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff",
"timestamp": "0x54e34e8e"
"totalDifficulty": "0x027f07",
"transactions": []
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
```
--------------------------------
### Define Get Payload Bodies By Range Request Container
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-8178.md
Defines the request container for retrieving execution payload bodies within a specified range of block numbers. Requires a start block number and the count of blocks.
```python
class GetPayloadBodiesByRangeRequest(Container):
start: uint64
count: uint64
```
--------------------------------
### Example Dapp Initialization with Account Request
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1102.md
This JavaScript example demonstrates how to use `await ethereum.send('eth_requestAccounts')` to request account access and handle potential errors, followed by sending a transaction.
```javascript
try {
// Request account access if needed
const accounts = await ethereum.send('eth_requestAccounts');
// Accounts now exposed, use them
ethereum.send('eth_sendTransaction', { from: accounts[0], /* ... */ })
} catch (error) {
// User denied account access
}
```
--------------------------------
### Install Bundler and Dependencies for EIP Status Page
Source: https://github.com/ethereum/eips/blob/master/README.md
Installs Bundler and project dependencies required to build the EIP status page locally. Assumes Ruby 3.1.4 is already installed.
```sh
gem install bundler
bundle install
```
--------------------------------
### Example Parameters for wallet_getCapabilities
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-5792.md
Illustrates the expected format for parameters when calling the wallet_getCapabilities RPC method, including a wallet address and a list of chain IDs.
```json
["0xd46e8dd67c5d32be8058bb8eb970870f07244567", ["0x2105", "0x14A34"]]
```
--------------------------------
### Example Return Value for wallet_getCapabilities
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-5792.md
Provides an example of the JSON response from wallet_getCapabilities, showing supported capabilities like 'flow-control', 'paymasterService', 'sessionKeys', and 'auxiliaryFunds' across different chains.
```json
{
"0x0": {
"flow-control": {
"supported": true
}
},
"0x2105": {
"paymasterService": {
"supported": true
},
"sessionKeys": {
"supported": true
}
},
"0x14A34": {
"auxiliaryFunds": {
"supported": true
}
}
}
```
--------------------------------
### Transaction Signing Hash Example
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-155.md
This example shows the hash of the RLP encoded transaction data, which is then signed.
```plaintext
0xdaf5a779ae972f972197303d7b574746c7ef83eadac0f2791ad23db92e4c8e53
```
--------------------------------
### EVM64 Test Case Example
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-7937.md
Demonstrates a test case for the 64-bit EVM mode, showing the input stack items, the `C0 SHR` opcode, and the expected output stack items after the operation.
```Solidity
[ff00000000000000 000000000000000 0000000000000ff 000000000000001, ff0000000000000 000000000000000 0000000000000ff f0000000000000f] C0 SHR => [<0> 780000000000007]
```
--------------------------------
### Submit Work Example (eth_submitWork)
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1474.md
Demonstrates how to submit proof-of-work to the Ethereum network using the eth_submitWork method. Includes both the request and response format.
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_submitWork",
"params": [
"0x0000000000000001",
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"0xD1GE5700000000000000000000000000D1GE5700000000000000000000000000"
]
}'
# Response
{
"id": 1337,
"jsonrpc": "2.0",
"result": true
}
```
--------------------------------
### Bundle Assets and Start Jekyll Server
Source: https://github.com/ethereum/eips/blob/master/README.md
Run this command in your project directory to bundle dependencies and start the local Jekyll development server. The site will be available at http://localhost:4000.
```sh
bundle exec jekyll serve
```
--------------------------------
### Wallet RPC: wallet_getCallsStatus Example Parameters
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-5792.md
Example parameter for the wallet_getCallsStatus RPC method, representing a batch identifier.
```json
[
"0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
]
```
--------------------------------
### Example `wallet_getCapabilities` Response
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-7867.md
An example response from `wallet_getCapabilities` showing the supported flow control options for chain '0x1', including 'halt' and 'continue' for 'loose' atomicity, and 'continue' for 'strict' atomicity.
```json
{
"0x1": {
"flowControl": {
"loose": ["halt", "continue"],
"strict": ["continue"]
}
}
}
```
--------------------------------
### Example Call-scope `wallet_sendCalls` Request
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-7867.md
An example JSON-RPC request for `wallet_sendCalls` demonstrating call-scope flow control with 'continue' on failure.
```javascript
[
{
"version": "1.0",
"from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"chainId": "0x01",
"calls": [
{
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"value": "0x182183",
"data": "0xfbadbaf01",
"capabilities": {
"flowControl": {
"onFailure": "continue"
}
}
}
]
}
]
```
--------------------------------
### Solidity Gas Tracking Example
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-2542.md
Illustrates how to track gas used within a Solidity function using the proposed `tx.gasLimit` and `gasleft()`.
```Solidity
function keepTrackOfGas(string memory message, uint256 number) public {
... // Other logic
uint gasUsed = msg.gasLimit - gasleft();
}
```
--------------------------------
### Wallet RPC: wallet_showCallsStatus Example Parameters
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-5792.md
Example parameter for the wallet_showCallsStatus RPC method, which accepts a call bundle identifier.
```typescript
type ShowCallsParams = string; // Call bundle identifier returned by wallet_sendCalls
```
```json
["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"]
```
--------------------------------
### Example Response for wallet_getCapabilities
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-7896.md
Illustrates a JSON response from `wallet_getCapabilities`, indicating support for interface specifications. The `interfaces` object includes a `versions` array listing supported ABI versions.
```json
{
"0x0": {
"interfaces": {
"supported": true,
"versions": ["abi-v1", "abi-v2"]
}
}
}
```
--------------------------------
### Uninstall Filter Example (eth_uninstallFilter)
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-1474.md
Demonstrates the usage of the eth_uninstallFilter method to destroy a filter. This is useful when a filter is no longer needed to prevent resource leaks.
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_uninstallFilter",
"params": ["0xb"]
}'
# Response
{
"id": 1337,
"jsonrpc": "2.0",
"result": true
}
```
--------------------------------
### wallet_sendCalls Example Return Value
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-5792.md
An example of the return value for the wallet_sendCalls RPC method, showing the transaction batch identifier.
```json
{
"id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
```
--------------------------------
### Example eth_sendTransactionToContractFunction Result
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-2566.md
This example illustrates the expected JSON-RPC response for a successful eth_sendTransactionToContractFunction call, returning the transaction hash.
```json
{
"id":1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
```
--------------------------------
### Container Conversion Example
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-7688.md
Demonstrates converting a standard Container to a ProgressiveContainer to support stable Merkleization.
```python
class Foo(Container):
a: uint8
b: uint16
```
```python
class Foo(ProgressiveContainer(active_fields=[1, 1])):
a: uint8
b: uint16
```
--------------------------------
### Example Batch-scope `wallet_sendCalls` Request
Source: https://github.com/ethereum/eips/blob/master/EIPS/eip-7867.md
An example JSON-RPC request for `wallet_sendCalls` demonstrating the batch-scope flow control capability with 'loose' atomicity.
```javascript
[
{
"version": "1.0",
"from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"chainId": "0x01",
"calls": [],
"capabilities": {
"flowControl": {
"atomicity": "loose"
}
}
}
]
```
--------------------------------
### Build Optimism-geth
Source: https://github.com/ethereum/eips/blob/master/assets/eip-7885/op-geth/cgo/README.md
Compile the Optimism-geth client after setting up liboqs and configuring the environment variables.
```bash
make geth
```