Repository navigation
docs: v6.7.0 catch-up #95
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
base: main
Are you sure you want to change the base?
Changes from all commits
16ce148
81b7e66
35822b4
3fbe09d
25ebb8c
5e373a9
648c233
3b24f94
1a0e2c2
6a08627
2254188
bc4e0a6
04a4cf4
a84ba06
d5f10e8
2ab34ae
2b6d1be
6b3e429
bf9c103
8f94f40
3ca40c3
0c2c694
9084555
8b59ed1
ba5bcb8
f8ba529
fa86ef5
dd39c36
0555a66
6b4093d
576ba51
9fe9770
6d0b2c2
4f550bd
fa932d5
7cc9ac2
d5c3b35
c2dc390
4311939
d30f9c6
0b15a48
ec1651c
a41747d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| --- | ||
| title: Auth Precompile | ||
| description: Query account information, auth module parameters, and the next account number from the EVM. | ||
| --- | ||
|
|
||
| The Auth precompile exposes read-only access to the Cosmos SDK `auth` module, letting Solidity contracts look up account details, the auth module parameters, and the next account number. All of its methods are views and never mutate state. | ||
|
|
||
| ## Address | ||
|
|
||
| The Auth precompile is available at the fixed address `0x000000000000000000000000000000000000100D`. | ||
|
|
||
| ## Solidity Interface | ||
|
|
||
| ```solidity | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| address constant AUTH_PRECOMPILE_ADDRESS = 0x000000000000000000000000000000000000100D; | ||
|
|
||
| IAuth constant AUTH_CONTRACT = IAuth(AUTH_PRECOMPILE_ADDRESS); | ||
|
|
||
| interface IAuth { | ||
| // Queries | ||
|
|
||
| /** | ||
| * @notice Get account information for the given address | ||
| * @param addr The EVM address (must be associated with a Sei address) | ||
| * @return account Account details | ||
| */ | ||
| function account( | ||
| address addr | ||
| ) external view returns (Account memory account); | ||
|
|
||
| /** | ||
| * @notice Get all accounts, paginated | ||
| * @param pageKey Pagination key (empty bytes for the first page) | ||
| * @return response Accounts response with pagination | ||
| */ | ||
| function accounts( | ||
| bytes memory pageKey | ||
| ) external view returns (AccountsResponse memory response); | ||
|
|
||
| /** | ||
| * @notice Get the auth module parameters | ||
| * @return params Auth module parameters | ||
| */ | ||
| function params() external view returns (AuthParams memory params); | ||
|
|
||
| /** | ||
| * @notice Get the next account number | ||
| * @return count The next account number | ||
| */ | ||
| function nextAccountNumber() external view returns (uint64 count); | ||
|
|
||
| // Structs | ||
|
|
||
| struct Account { | ||
| string accountAddress; | ||
| uint64 accountNumber; | ||
| uint64 sequence; | ||
| } | ||
|
|
||
| struct AccountsResponse { | ||
| Account[] accounts; | ||
| bytes nextKey; | ||
| } | ||
|
|
||
| struct AuthParams { | ||
| uint64 maxMemoCharacters; | ||
| uint64 txSigLimit; | ||
| uint64 txSizeCostPerByte; | ||
| uint64 sigVerifyCostEd25519; | ||
| uint64 sigVerifyCostSecp256k1; | ||
| bool disableSeqnoCheck; | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Methods | ||
|
|
||
| ### account | ||
|
Check warning on line 81 in evm/precompiles/auth.mdx
|
||
|
|
||
| ```solidity | ||
| function account(address addr) external view returns (Account memory account); | ||
| ``` | ||
|
|
||
| Returns the `Account` details (address, account number, and sequence) for the Sei address associated with `addr`. The EVM address must be associated with a Sei address; if it is not, or if no account exists for the resolved address, the call reverts. | ||
|
|
||
| ### accounts | ||
|
Check warning on line 89 in evm/precompiles/auth.mdx
|
||
|
|
||
| ```solidity | ||
| function accounts(bytes memory pageKey) external view returns (AccountsResponse memory response); | ||
| ``` | ||
|
|
||
| Returns a paginated list of all accounts. Pass empty `bytes` for the first page, then supply the returned `nextKey` to fetch subsequent pages. | ||
|
|
||
| ### params | ||
|
Check warning on line 97 in evm/precompiles/auth.mdx
|
||
|
|
||
| ```solidity | ||
| function params() external view returns (AuthParams memory params); | ||
| ``` | ||
|
|
||
| Returns the auth module parameters, including `maxMemoCharacters`, `txSigLimit`, `txSizeCostPerByte`, `sigVerifyCostEd25519`, `sigVerifyCostSecp256k1`, and `disableSeqnoCheck`. | ||
|
|
||
| ### nextAccountNumber | ||
|
Check warning on line 105 in evm/precompiles/auth.mdx
|
||
|
|
||
| ```solidity | ||
| function nextAccountNumber() external view returns (uint64 count); | ||
| ``` | ||
|
|
||
| Returns the next account number. This is a read-only view and does not increment the persisted global account number counter, so repeated calls return the same value. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| --- | ||
| title: Authz Precompile | ||
| description: Query authorization grants from the Cosmos authz module directly from EVM smart contracts on Sei. | ||
| --- | ||
|
|
||
| The Authz precompile exposes read-only queries from the Cosmos `authz` module to EVM smart contracts. It lets contracts inspect authorization grants between a granter and a grantee, as well as all grants issued or received by a given account. | ||
|
|
||
| ## Address | ||
|
|
||
| The Authz precompile is available at the fixed address: | ||
|
|
||
| ``` | ||
| 0x000000000000000000000000000000000000100E | ||
| ``` | ||
|
|
||
| ## Interface | ||
|
|
||
| ```solidity | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| address constant AUTHZ_PRECOMPILE_ADDRESS = 0x000000000000000000000000000000000000100e; | ||
|
|
||
| IAuthz constant AUTHZ_CONTRACT = IAuthz(AUTHZ_PRECOMPILE_ADDRESS); | ||
|
|
||
| interface IAuthz { | ||
| // Queries | ||
|
|
||
| /** | ||
| * @notice Get grants between a granter and a grantee, optionally filtered by message type URL | ||
| * @param granter The granter's EVM address (must be associated with a Sei address) | ||
| * @param grantee The grantee's EVM address (must be associated with a Sei address) | ||
| * @param msgTypeUrl The message type URL to filter by (empty string for all) | ||
| * @param pageKey Pagination key (empty bytes for the first page) | ||
| * @return response Grants response with pagination | ||
| */ | ||
| function grants( | ||
| address granter, | ||
| address grantee, | ||
| string memory msgTypeUrl, | ||
| bytes memory pageKey | ||
| ) external view returns (GrantsResponse memory response); | ||
|
|
||
| /** | ||
| * @notice Get all grants granted by a granter | ||
| * @param granter The granter's EVM address (must be associated with a Sei address) | ||
| * @param pageKey Pagination key (empty bytes for the first page) | ||
| * @return response Grant authorizations response with pagination | ||
| */ | ||
| function granterGrants( | ||
| address granter, | ||
| bytes memory pageKey | ||
| ) external view returns (GrantAuthorizationsResponse memory response); | ||
|
|
||
| /** | ||
| * @notice Get all grants granted to a grantee | ||
| * @param grantee The grantee's EVM address (must be associated with a Sei address) | ||
| * @param pageKey Pagination key (empty bytes for the first page) | ||
| * @return response Grant authorizations response with pagination | ||
| */ | ||
| function granteeGrants( | ||
| address grantee, | ||
| bytes memory pageKey | ||
| ) external view returns (GrantAuthorizationsResponse memory response); | ||
|
|
||
| // Structs | ||
|
|
||
| struct Grant { | ||
| bytes authorization; | ||
| int64 expiration; | ||
| } | ||
|
|
||
| struct GrantsResponse { | ||
| Grant[] grants; | ||
| bytes nextKey; | ||
| } | ||
|
|
||
| struct GrantAuthorization { | ||
| string granter; | ||
| string grantee; | ||
| bytes authorization; | ||
| int64 expiration; | ||
| } | ||
|
|
||
| struct GrantAuthorizationsResponse { | ||
| GrantAuthorization[] grants; | ||
| bytes nextKey; | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Methods | ||
|
|
||
| All methods on this precompile are read-only `view` queries. They do not mutate state. | ||
|
|
||
| ### grants | ||
|
Check warning on line 96 in evm/precompiles/authz.mdx
|
||
|
|
||
| Returns the grants between a specific granter and grantee, optionally filtered by a message type URL. | ||
|
|
||
| ```solidity | ||
| function grants( | ||
| address granter, | ||
| address grantee, | ||
| string memory msgTypeUrl, | ||
| bytes memory pageKey | ||
| ) external view returns (GrantsResponse memory response); | ||
| ``` | ||
|
|
||
| - `granter` — the granter's EVM address, which must be associated with a Sei address. | ||
| - `grantee` — the grantee's EVM address, which must be associated with a Sei address. | ||
| - `msgTypeUrl` — the message type URL to filter by. Pass an empty string to return all grants. | ||
| - `pageKey` — the pagination key; pass empty bytes to request the first page. | ||
|
|
||
| Each returned `Grant` contains the `authorization` encoded as JSON bytes and an `expiration` expressed as a Unix timestamp in seconds. The `nextKey` field of the response is the pagination key for the next page (empty when the result set is exhausted). | ||
|
|
||
| ### granterGrants | ||
|
Check warning on line 116 in evm/precompiles/authz.mdx
|
||
|
|
||
| Returns every grant issued by a given granter. | ||
|
|
||
| ```solidity | ||
| function granterGrants( | ||
| address granter, | ||
| bytes memory pageKey | ||
| ) external view returns (GrantAuthorizationsResponse memory response); | ||
| ``` | ||
|
|
||
| - `granter` — the granter's EVM address, which must be associated with a Sei address. | ||
| - `pageKey` — the pagination key; pass empty bytes to request the first page. | ||
|
|
||
| Each returned `GrantAuthorization` includes the bech32 `granter` and `grantee` addresses, the `authorization` encoded as JSON bytes, and an `expiration` as a Unix timestamp in seconds. | ||
|
|
||
| ### granteeGrants | ||
|
Check warning on line 132 in evm/precompiles/authz.mdx
|
||
|
|
||
| Returns every grant received by a given grantee. | ||
|
|
||
| ```solidity | ||
| function granteeGrants( | ||
| address grantee, | ||
| bytes memory pageKey | ||
| ) external view returns (GrantAuthorizationsResponse memory response); | ||
| ``` | ||
|
|
||
| - `grantee` — the grantee's EVM address, which must be associated with a Sei address. | ||
| - `pageKey` — the pagination key; pass empty bytes to request the first page. | ||
|
|
||
| The response mirrors `granterGrants`, listing each `GrantAuthorization` with its granter, grantee, JSON-encoded authorization, and expiration. | ||
|
|
||
| ## Notes | ||
|
|
||
| - The addresses passed to these methods must be associated with a Sei address; querying an unassociated address reverts. | ||
| - The `authorization` field is returned as JSON-encoded bytes and includes an `@type` discriminator (for example, a `SendAuthorization`). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retired precompiles listed as active
Medium Severity
The new decode-cost section lists
oracleandibcamong current dynamic-gas precompiles. Native Oracle is retired and IBC is disabled; docs must not present either as an active call path.Triggered by learned rule: Native Oracle precompile retired — flag new usage docs
Reviewed by Cursor Bugbot for commit a41747d. Configure here.