Skip to content

Commit 6c2f638

Browse files
committed
Add a couple EVM-related pages
1 parent b5307bd commit 6c2f638

File tree

5 files changed

+304
-0
lines changed

5 files changed

+304
-0
lines changed

pages/differences-with-ethereum.mdx

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Differences with Ethereum
2+
## Opcode Differences
3+
4+
### PREVRANDAO
5+
6+
Since Sei doesn’t rely on the same pseudo-randomness way of determining the next validator like PoS Ethereum does, it doesn’t really have the `RANDOM` artifact that can be set as `PREVRANDO`'s return value. In Sei `PREVRANDAO` is set to return the hash of the current block time. For strong randomness guarantee needs in contracts logic, it’s advised to use external verifiable oracles (as is advised on Ethereum itself)
7+
8+
### COINBASE
9+
10+
Coinbase address on Sei is always sets to (the EVM address of) the global fee collector.
11+
12+
## State Root
13+
14+
Since Sei uses AVL-tree instead of MPT for data storage, Sei doesn’t have per-account state root. The global state root is the AVL-tree root which is also not equivalent to Ethereum’s overall state root (which is a MPT root)
15+
16+
## Block Hash
17+
18+
Block hash on Sei is computed based on block header in Tendermint data format, and as a result is different than Ethereum’s block Hash
19+
20+
## Base Fee & Tips
21+
22+
Sei supports all transaction types. However Sei does not fluctuate base fee based on block congestion. In fact base fee will always be 0 on Sei, meaning all fees will go to the validators (i.e. tips) and none will be burnt.
23+
24+
## Block Limit
25+
26+
Sei has a gas limit of 10M on pacific-1, compared to Ethereum’s 30M. In addition, Sei also has a byte size limit of 21MB, whereas Ethereum doesn’t have byte-denominated limits.
27+
28+
## Non-EVM Transactions
29+
30+
On Sei there exists non-EVM transactions which may update states accessible by EVM transactions. Simplest example would be bank balances, which may be updated by both native Cosmos bank send transactions and EVM send transactions. As a result, if certain offchain applications only parse EVM transactions, they may find certain state changes unattributable to any EVM transaction.
31+
32+
## Finality
33+
34+
Sei has instant finality, meaning that commitment levels of “safe”, “latest”, “justified”, and “finalized” on Ethereum are all the same thing on Sei.
35+
36+
## Pending State
37+
38+
On Ethereum the block proposer would execute its proposed block first (and update its local state) before broadcasting the proposal to others (the updated state would be marked “pending” until the node is accepted by other nodes), whereas on Sei the block proposer would broadcast first and only execute the proposal if it’s accepted (i.e. every node would execute the block at roughly the same time), so Sei does not really have a window when “pending state” exists.
39+
40+
## EIP-4788
41+
42+
On Ethereum, the Consensus Layer (CL) block root is published to the Execution Layer (EL) to give verifiable CL state to apps that rely on CL state without going through a third-party oracle. On Sei, we will instead rely on the staking precompile to give smart contracts access to state of the CL. The EL can stake, delegate, undelegate, and read CL state using the staking precompile.

pages/evm-rpc-endpoints.mdx

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# EVM RPC Endpoints
2+
Below is a list of EVM-RPC endpoints provided by default on a Sei RPC node. Your RPC provider may offer slightly different/extended specifications.
3+
4+
All endpoints are in the form of JSON-RPC and share the following request/response structure:
5+
- request
6+
- HTTP method: always "GET"
7+
- header: `accept: application/json`
8+
- header: `content-type: application/json`
9+
- body (JSON):
10+
- id: an arbitrary string identifier
11+
- jsonrpc: always "2.0"
12+
- method: endpoint name (e.g. "eth_sendRawTransaction")
13+
- params: an array that differs from endpoint to endpoint
14+
- response
15+
- body (JSON):
16+
- id: the same identifier in request
17+
- jsonrpc: always "2.0"
18+
- result: an object that differs from endpoint to endpoint
19+
20+
21+
## Send Transactions
22+
### eth_sendRawTransaction
23+
Sends a signed transaction.
24+
- param 1: string | hex-encoding of the signed transaction
25+
- result: string | transaction hash
26+
27+
### sei_associate
28+
Sends a transaction to establish association between the signer's Sei address and EVM address on-chain
29+
- param 1: object
30+
- custom_message: any string message
31+
- r: the R-part of the signature over the Keccak256 hash of the custom message
32+
- s: the S-part of the signature over the Keccak256 hash of the custom message
33+
- v: the V-part of the signature over the Keccak256 hash of the custom message
34+
35+
## Transaction Lookup
36+
### eth_getTransactionReceipt
37+
Gets the receipt of a sent transaction
38+
- param 1: string | transaction hash
39+
- result: object | [receipt object](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)
40+
41+
### eth_getTransactionByBlockNumberAndIndex
42+
Gets transaction by the block number and the index of the transaction in the block
43+
- param 1: string | block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
44+
- param 2: string | transaction index as a hexadecimal number
45+
- result: object | [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash)
46+
47+
### eth_getTransactionByBlockHashAndIndex
48+
Gets transaction by the block hash and the index of the transaction in the block
49+
- param 1: string | block hash
50+
- param 2: string | transaction index as a hexadecimal number
51+
- result: object | [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash)
52+
53+
### eth_getTransactionByHash
54+
Gets transaction by the transaction hash
55+
- param 1: string | transaction hash
56+
- result: object | [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash)
57+
58+
## Account Information
59+
### eth_getTransactionCount
60+
Gets the number of transactions sent by the account
61+
- param 1: string | address
62+
- param 2: string | block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
63+
- result: string | hexadecimal form of the number of transactions
64+
65+
### eth_getBalance
66+
Gets the balance in wei (i.e. 10^-12 usei) of the account
67+
- param 1: string | address
68+
- param 2: string | block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
69+
- result: string | hexadecimal form of the wei balance
70+
71+
### eth_getCode
72+
Gets EVM code stored at the account address
73+
- param 1: string | address
74+
- param 2: string | block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
75+
- result: string | hexadecimal form of the code binary
76+
77+
### eth_getStorageAt
78+
Gets value at given key of the account
79+
- param 1: string | address
80+
- param 2: string | hexadecimal form of the key
81+
- param 3: string | block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
82+
- result: string | hexadecimal form of the storage value
83+
84+
### eth_getProof
85+
Gets the IAVL proof (note: not a MPT proof) of the given keys for an account
86+
- param 1: string | address
87+
- param 2: array of string | hexadecimal form of the keys
88+
- param 3: string | block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
89+
- result: object
90+
- address - the requested address
91+
- hexValues - an array of the hexdecimal form of the values at the given keys
92+
- storageProof - an array of storage proofs, each of which follows this [format](https://github.com/sei-protocol/sei-tendermint/blob/main/proto/tendermint/crypto/proof.pb.go#L272-L274)
93+
94+
## Block Information
95+
### eth_getBlockTransactionCountByNumber
96+
Gets the count of EVM transactions (i.e. excluding native Cosmos transactions) in a block by its number
97+
- param 1: string | block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
98+
- result: string | hexadecimal form of the count
99+
100+
### eth_getBlockTransactionCountByHash
101+
Gets the count of EVM transactions (i.e. excluding native Cosmos transactions) in a block by its hash
102+
- param 1: string | block hash
103+
- result: string | hexadecimal form of the count
104+
105+
### eth_getBlockByHash
106+
Gets the block metadata and/or its EVM transactions by block hash
107+
- param 1: string | block hash
108+
- param 2: bool | whether to include transactions in the response
109+
- result: object | [block info](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash)
110+
111+
### eth_getBlockByNumber
112+
Gets the block metadata and/or its EVM transactions by block number
113+
- param 1: string | block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
114+
- param 2: bool | whether to include transactions in the response
115+
- result: object | [block info](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash)
116+
117+
### eth_getBlockReceipts
118+
Gets an array of EVM transaction receipt in a block by block number
119+
- param 1: string | block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
120+
- result: array of objects | [receipt object](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)
121+
122+
## Blockchain Information
123+
### eth_blockNumber
124+
Gets the latest committed block number
125+
- no param
126+
- result: string | hexadecimal form of the block number
127+
128+
### eth_chainId
129+
Gets the chain ID
130+
- no param
131+
- result: string | hexadecimal form of the chain ID
132+
133+
### eth_coinbase
134+
Gets the fee collector address
135+
- no param
136+
- result: string | fee collector address
137+
138+
### eth_feeHistory
139+
Gets fee history over the requested block range
140+
- param 1: string | number of blocks to look at, in either decimal or hexadecimal form
141+
- param 2: string | block number, which can either be a hexadecimal number, or one of "safe", "finalized", or "latest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality.
142+
- param 3: array of floats | reward percentiles
143+
- result: object
144+
145+
### eth_gasPrice
146+
Gets the 50% percentile of gas prices in the most recent block
147+
- no param
148+
- result: string | hexadecimal form of the gas price
149+
150+
### net_version
151+
Gets the version (equal to Chain ID)
152+
- no param
153+
- result: string | hexadecimal form of the chain ID
154+
155+
### web3_clientVersion
156+
- no param
157+
- result: string | the RPC node's runtime version
158+
159+
## Filter Endpoints
160+
Note that log filters are subject to the following limits by default:
161+
- 10000 logs in one response if block range is open-ended
162+
- 2000 blocks to query over if block range is close-ended
163+
Your RPC provider may tweak these limits.
164+
165+
### eth_newFilter
166+
Creates a new log filter for later queries
167+
- param 1: object | [filter criteria](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
168+
- result: string | the newly created filter's ID
169+
170+
### eth_newBlockFilter
171+
Creates a new block filter for later queries
172+
- no param
173+
- result: string | the newly created filter's ID
174+
175+
### eth_getFilterChanges
176+
Gets all the updates since the filter was last queried
177+
- param 1: string | filter ID
178+
- result: array | for block filters, the result would be an array of block hashes; for log filters, the result would be an array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
179+
180+
### eth_getFilterLogs
181+
Get all logs for a given log filter, including the logs that have been returned before
182+
- param 1: string | filter ID
183+
- result: array | an array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
184+
185+
### eth_getLogs
186+
Get all logs for the given filter criteria
187+
- param 1: object | [filter criteria](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
188+
- result: array | an array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
189+
190+
### eth_uninstallFilter
191+
Removes a created filter
192+
- param 1: string | filter ID
193+
- result: bool | whether the filter exists
194+
195+
## Simulation Endpoints
196+
### eth_estimateGas
197+
Same as [the official specification](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
198+
199+
### eth_call
200+
Same as [the official specification](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)
201+
202+
## Debugging Endpoints
203+
### debug_traceTransaction
204+
Same as [Alchemy](https://docs.alchemy.com/reference/debug-tracetransaction)
205+
206+
### debug_traceBlockByNumber
207+
Same as [Alchemy](https://docs.alchemy.com/reference/debug-traceblockbynumber)
208+
209+
### debug_traceBlockByHash
210+
Same as [Alchemy](https://docs.alchemy.com/reference/debug-traceblockbyhash)

pages/interoperability/overview.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ImageWithCaption } from "../../components";
22
import interoperability from "../../public/assets/interoperability.png";
33

4+
# EVM version
5+
Shanghai
6+
47
# EVM \<\> Wasm Interoperability
58
EVM and Cosmos based applications co-exist on Sei, but live in different execution environments.
69
This creates a challenge for users, who use wallets that typically only support a single execution environment.

pages/quickstart/evm-cli-tutorial.mdx

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Interact with EVM on Sei via CLI
2+
You can query or send transactions to Sei easily via CLI once you have the `seid` command installed (see `Installing Seid`)
3+
4+
## Queries
5+
If the machine you run these commands aren't a node of the network, you'd need to append `--node http://url-to-sei-cosmos-rpc` to your command.
6+
7+
- `seid q evm sei-addr [some EVM address]`: gets the associated Sei address, if exists on-chain, of the queried EVM address
8+
- `seid q evm evm-addr [some Sei address]`: gets the associated EVM address, if exists on-chain, of the queried Sei address
9+
- `seid q evm erc20 [erc20 address] [method] [arguments...]`: query the ERC20 contract at given address for the given method/arguments
10+
- `seid q evm payload [abi-filepath] [method] [arguments...]`: generate the hexadecimal payload of the requested method call given an ABI
11+
- `seid q evm pointer [type] [pointee]`: gets the pointer contract of the requested pointee. `type` can be one of "NATIVE", "CW20", "CW721", "ERC20", or "ERC721", and `pointee` is the target contract address (except for "NATIVE" type, for which `pointee` would be the native denom name)
12+
13+
## Transactions
14+
Sending transactions via CLI requires you to have keys added via `seid keys add`. You can then specify the key you want to use by appending `--from=[key name]` to your command.
15+
16+
If the machine you run these commands aren't a node of the network, you'd need to append `--evm-rpc http://url-to-sei-evm-rpc` to your command.
17+
18+
- `seid tx evm associate-address`: associate Sei address and EVM address on-chain for the sending key
19+
- `seid tx evm send [to EVM address] [amount in wei]`: send native tokens to the target EVM address
20+
- `seid tx evm deploy [path to binary]`: deploy an EVM contract
21+
- `seid tx evm call-contract [addr] [payload hex]`: send a transaction that calls contract at the target address with the provided payload
22+
- `seid tx evm erc20-send [addr] [recipient] [amount]`: send ERC20 tokens of contract at `addr` to the target recipient
23+
- `seid tx evm delegate [val-addr] [amount]`: delegate specified amount to the target validator address. Note that the validator address would be in Sei/Cosmos validator address format

pages/tools-and-resources.mdx

+26
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,29 @@ To support your development and testing efforts, we provide a range of public RP
4545
</Tabs>
4646

4747
For more endpoint options, please visit our [chain registry](https://github.com/sei-protocol/chain-registry/blob/main/chains.json).
48+
49+
## Important Contract Info
50+
Wrapped Sei
51+
arctic-1: 0x63600a899ad94ae1bc638504fa56d8a6144df2fe
52+
atlantic-2: TODO
53+
pacific-1: TODO
54+
55+
USDC
56+
arctic-1: TODO
57+
atlantic-2: TODO
58+
pacific-1: TODO
59+
60+
CW20 Pointer Code for ERC20
61+
arctic-1: TODO
62+
atlantic-2: TODO
63+
pacific-1: TODO
64+
65+
CW721 Pointer Code for ERC20
66+
arctic-1: TODO
67+
atlantic-2: TODO
68+
pacific-1: TODO
69+
70+
LayerZero Endpoint
71+
arctic-1: 40258
72+
atlantic-2: TODO
73+
pacific-1: TODO

0 commit comments

Comments
 (0)