Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/alloy/src/rpc/reth_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ impl TryIntoTxEnv<TempoTxEnv, TempoHardfork, TempoBlockEnv> for TempoTransaction
Ok(TempoTxEnv {
fee_token,
is_system_tx: false,
channel_open_context_hash: None,
fee_payer,
tempo_tx_env: if !calls.is_empty()
|| !tempo_authorization_list.is_empty()
Expand Down
26 changes: 19 additions & 7 deletions crates/contracts/src/precompiles/tip20_channel_escrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ crate::sol! {
struct ChannelDescriptor {
address payer;
address payee;
address operator;
address token;
bytes32 salt;
address authorizedSigner;
bytes32 expiringNonceHash;
}

struct ChannelState {
uint96 settled;
uint96 deposit;
uint32 closeData;
uint32 closeRequestedAt;
}

struct Channel {
Expand All @@ -36,6 +38,7 @@ crate::sol! {

function open(
address payee,
address operator,
address token,
uint96 deposit,
bytes32 salt,
Expand Down Expand Up @@ -84,9 +87,11 @@ crate::sol! {
function computeChannelId(
address payer,
address payee,
address operator,
address token,
bytes32 salt,
address authorizedSigner
address authorizedSigner,
bytes32 expiringNonceHash
)
external
view
Expand All @@ -103,9 +108,11 @@ crate::sol! {
bytes32 indexed channelId,
address indexed payer,
address indexed payee,
address operator,
address token,
address authorizedSigner,
bytes32 salt,
bytes32 expiringNonceHash,
uint96 deposit
);

Expand Down Expand Up @@ -149,12 +156,13 @@ crate::sol! {

error ChannelAlreadyExists();
error ChannelNotFound();
error ChannelFinalized();
error NotPayer();
error NotPayee();
error NotPayeeOrOperator();
error InvalidPayee();
error InvalidToken();
error ZeroDeposit();
error ExpiringNonceHashNotSet();
error InvalidSignature();
error AmountExceedsDeposit();
error AmountNotIncreasing();
Expand All @@ -174,10 +182,6 @@ impl TIP20ChannelEscrowError {
Self::ChannelNotFound(ITIP20ChannelEscrow::ChannelNotFound {})
}

pub const fn channel_finalized() -> Self {
Self::ChannelFinalized(ITIP20ChannelEscrow::ChannelFinalized {})
}

pub const fn not_payer() -> Self {
Self::NotPayer(ITIP20ChannelEscrow::NotPayer {})
}
Expand All @@ -186,6 +190,10 @@ impl TIP20ChannelEscrowError {
Self::NotPayee(ITIP20ChannelEscrow::NotPayee {})
}

pub const fn not_payee_or_operator() -> Self {
Self::NotPayeeOrOperator(ITIP20ChannelEscrow::NotPayeeOrOperator {})
}

pub const fn invalid_payee() -> Self {
Self::InvalidPayee(ITIP20ChannelEscrow::InvalidPayee {})
}
Expand All @@ -198,6 +206,10 @@ impl TIP20ChannelEscrowError {
Self::ZeroDeposit(ITIP20ChannelEscrow::ZeroDeposit {})
}

pub const fn expiring_nonce_hash_not_set() -> Self {
Self::ExpiringNonceHashNotSet(ITIP20ChannelEscrow::ExpiringNonceHashNotSet {})
}

pub const fn invalid_signature() -> Self {
Self::InvalidSignature(ITIP20ChannelEscrow::InvalidSignature {})
}
Expand Down
5 changes: 3 additions & 2 deletions crates/precompiles/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ use revm::{
};
use tempo_contracts::precompiles::{
AccountKeychainError, AddrRegistryError, FeeManagerError, NonceError, RolesAuthError,
SignatureVerifierError, StablecoinDEXError, TIP20ChannelEscrowError, TIP20FactoryError, TIP403RegistryError,
TIPFeeAMMError, UnknownFunctionSelector, ValidatorConfigError, ValidatorConfigV2Error,
SignatureVerifierError, StablecoinDEXError, TIP20ChannelEscrowError, TIP20FactoryError,
TIP403RegistryError, TIPFeeAMMError, UnknownFunctionSelector, ValidatorConfigError,
ValidatorConfigV2Error,
};

/// Top-level error type for all Tempo precompile operations
Expand Down
4 changes: 2 additions & 2 deletions crates/precompiles/src/tip20_channel_escrow/dispatch.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! ABI dispatch for the [`TIP20ChannelEscrow`] precompile.

use super::{TIP20ChannelEscrow, CLOSE_GRACE_PERIOD, VOUCHER_TYPEHASH};
use crate::{charge_input_cost, dispatch_call, metadata, mutate, mutate_void, view, Precompile};
use super::{CLOSE_GRACE_PERIOD, TIP20ChannelEscrow, VOUCHER_TYPEHASH};
use crate::{Precompile, charge_input_cost, dispatch_call, metadata, mutate, mutate_void, view};
use alloy::{primitives::Address, sol_types::SolInterface};
use revm::precompile::PrecompileResult;
use tempo_contracts::precompiles::{
Expand Down
Loading
Loading