Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Oct 21, 2024
1 parent a15b37e commit 9c3f7fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ Consult the [Kurtosis OP package](https://github.com/ethpandaops/optimism-packag

Odyssey has a custom `wallet_` namespace, that allows users to delegate their EOAs to a contract using EIP-7702, and perform transactions on those accounts, all funded by the sequencer.

To enable this namespace, set the environment variable `EXP1_SK` to a private key that will sign the transactions, and `EXP1_WHITELIST` to a comma-delimited list of checksummed addresses accounts are allowed to delegate to. The new RPC method, `wallet_sendTransaction`, will only sign transactions that either:
To enable this namespace, set the environment variable `EXP1_SK` to a private key that will sign the transactions. The new RPC method, `wallet_sendTransaction`, will only sign transactions that either:

1. Delegate accounts to one of the whitelisted addresses using EIP-7702, or
1. Send transactions to an EIP-7702 EOA that is already delegated to a whitelisted address
1. Designates a contract address to an EOA via EIP-7702, or
2. Send transactions to an EIP-7702 EOA that is already delegated to an address

The `wallet_sendTransaction` endpoint accepts the same fields as `eth_sendTransaction`, with these notable exceptions:

Expand All @@ -147,8 +147,6 @@ The following fields are ignored, as they are overwritten internally:
1. `gasLimit`
1. `chainId`

To get the list of contracts that are whitelisted for `wallet_sendTransaction`, you can query `wallet_getCapabilities`.

### Security

See [SECURITY.md](SECURITY.md).
Expand Down
12 changes: 2 additions & 10 deletions crates/wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ pub trait OdysseyWalletApi {
///
/// The transaction will only be processed if:
///
/// - The transaction is an [EIP-7702][eip-7702] transaction that delegates to one of the
/// addresses listed in [`DelegationCapability`] (see [`Self::get_capabilities`])
/// - The transaction is an [EIP-7702][eip-7702] transaction.
/// - The transaction is an [EIP-1559][eip-1559] transaction to an EOA that is currently
/// delegated to one of the addresses above
/// - The value in the transaction is exactly 0.
Expand Down Expand Up @@ -121,19 +120,12 @@ pub enum OdysseyWalletError {
/// Requests with the nonce field set are rejected, as this is managed by the sequencer.
#[error("tx nonce is set")]
NonceSet,
/// An authorization item was invalid.
///
/// The item is invalid if it tries to delegate an account to a contract that is not
/// whitelisted.
#[error("invalid authorization address")]
InvalidAuthorization,
/// The to field of the transaction was invalid.
///
/// The destination is invalid if:
///
/// - There is no bytecode at the destination, or
/// - The bytecode is not an EIP-7702 delegation designator, or
/// - The delegation designator points to a contract that is not whitelisted
/// - The bytecode is not an EIP-7702 delegation designator
#[error("the destination of the transaction is not a delegated account")]
IllegalDestination,
/// The transaction request was invalid.
Expand Down

0 comments on commit 9c3f7fe

Please sign in to comment.