repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/providers/eth_provider/database/types/transaction.rs
src/providers/eth_provider/database/types/transaction.rs
use alloy_primitives::B256; use alloy_rpc_types::Transaction; use alloy_serde::WithOtherFields; use serde::{Deserialize, Serialize}; use starknet::core::types::Felt; use std::ops::Deref; #[cfg(any(test, feature = "arbitrary", feature = "testing"))] use { alloy_consensus::Transaction as _, alloy_primitives::U256...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/providers/eth_provider/database/types/serde/mod.rs
src/providers/eth_provider/database/types/serde/mod.rs
use serde::{de::value::MapDeserializer, Deserialize, Deserializer}; use serde_json::Value; use std::collections::HashMap; /// Used in order to perform a custom deserialization of the stored /// Ethereum data from the database. /// /// All the primitive types are stored as strings in the database. This caused problems ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/providers/sn_provider/mod.rs
src/providers/sn_provider/mod.rs
pub mod starknet_provider; pub use starknet_provider::StarknetProvider;
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/providers/sn_provider/starknet_provider.rs
src/providers/sn_provider/starknet_provider.rs
use crate::{ into_via_wrapper, providers::eth_provider::{ error::ExecutionError, starknet::{ERC20Reader, STARKNET_NATIVE_TOKEN}, utils::{class_hash_not_declared, contract_not_found}, }, }; use alloy_primitives::U256; use starknet::{ core::types::{BlockId, Felt}, providers::Pr...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/config.rs
src/eth_rpc/config.rs
use eyre::{eyre, Result}; #[derive(Debug, Clone)] pub struct RPCConfig { pub socket_addr: String, } impl RPCConfig { pub const fn new(socket_addr: String) -> Self { Self { socket_addr } } pub fn from_env() -> Result<Self> { let socket_addr = std::env::var("KAKAROT_RPC_URL") ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/mod.rs
src/eth_rpc/mod.rs
// //! Kakarot RPC module for Ethereum. // //! It is an adapter layer to interact with Kakarot ZK-EVM. pub mod api; pub mod config; pub mod middleware; pub mod rpc; pub mod servers; use crate::{ eth_rpc::middleware::{metrics::RpcMetrics, MetricsLayer}, prometheus_handler::init_prometheus, }; use config::RPCCo...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/rpc.rs
src/eth_rpc/rpc.rs
use crate::{ client::EthClient, eth_rpc::{ api::{ alchemy_api::AlchemyApiServer, debug_api::DebugApiServer, eth_api::EthApiServer, kakarot_api::KakarotApiServer, net_api::NetApiServer, trace_api::TraceApiServer, txpool_api::TxPoolApiServer, web3_api::Web3ApiServer, ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/middleware/mod.rs
src/eth_rpc/middleware/mod.rs
// This file is part of Substrate. // Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Softwa...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/middleware/metrics.rs
src/eth_rpc/middleware/metrics.rs
// This file is part of Substrate. // Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Softwa...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/debug_api.rs
src/eth_rpc/api/debug_api.rs
use alloy_primitives::{Bytes, B256}; use alloy_rpc_types::{BlockId, BlockNumberOrTag, TransactionRequest}; use alloy_rpc_types_trace::geth::{GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; /// Debug API /// Taken from Reth's DebugApi tr...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/kakarot_api.rs
src/eth_rpc/api/kakarot_api.rs
use crate::providers::eth_provider::constant::Constant; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; #[rpc(server, namespace = "kakarot")] #[async_trait] pub trait KakarotApi { #[method(name = "getConfig")] async fn get_config(&self) -> RpcResult<Constant>; }
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/alchemy_api.rs
src/eth_rpc/api/alchemy_api.rs
use crate::models::token::{TokenBalances, TokenMetadata}; use alloy_primitives::{Address, U256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; #[rpc(server, namespace = "alchemy")] #[async_trait] pub trait AlchemyApi { #[method(name = "getTokenBalances")] async fn token_balances(&self, address: Address, ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/net_api.rs
src/eth_rpc/api/net_api.rs
use alloy_primitives::U64; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; // TODO: Define and implement of methods of Net API #[rpc(server, namespace = "net")] #[async_trait] pub trait NetApi { /// Returns the protocol version encoded as a string. #[method(name = "version")] async fn version(&self) ->...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/txpool_api.rs
src/eth_rpc/api/txpool_api.rs
use crate::providers::eth_provider::database::types::transaction::ExtendedTransaction; use alloy_primitives::Address; use alloy_rpc_types_txpool::{TxpoolContent, TxpoolContentFrom, TxpoolInspect, TxpoolStatus}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; /// Txpool API #[rpc(server, namespace = "txpool")] #[as...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/mod.rs
src/eth_rpc/api/mod.rs
pub mod alchemy_api; pub mod debug_api; pub mod eth_api; pub mod kakarot_api; pub mod net_api; pub mod trace_api; pub mod txpool_api; pub mod web3_api;
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/trace_api.rs
src/eth_rpc/api/trace_api.rs
use alloy_rpc_types::BlockId; use alloy_rpc_types_trace::parity::LocalizedTransactionTrace; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; /// Trace API #[rpc(server, namespace = "trace")] #[async_trait] pub trait TraceApi { /// Returns the parity traces for the given block. #[method(name = "block")] ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/web3_api.rs
src/eth_rpc/api/web3_api.rs
use alloy_primitives::{Bytes, B256}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; #[rpc(server, namespace = "web3")] #[async_trait] pub trait Web3Api { /// Returns the client version of the running Kakarot RPC #[method(name = "clientVersion")] fn client_version(&self) -> RpcResult<String>; /// ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/api/eth_api.rs
src/eth_rpc/api/eth_api.rs
use crate::providers::eth_provider::database::types::receipt::ExtendedTxReceipt; use alloy_eips::{BlockId, BlockNumberOrTag}; use alloy_primitives::{Address, Bytes, B256, B64, U256, U64}; use alloy_rpc_types::{ serde_helpers::JsonStorageKey, state::StateOverride, AccessListResult, Block, BlockOverrides, EIP1186...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/trace_rpc.rs
src/eth_rpc/servers/trace_rpc.rs
use crate::{ eth_rpc::api::trace_api::TraceApiServer, providers::eth_provider::provider::EthereumProvider, tracing::builder::TracerBuilder, }; use alloy_rpc_types::BlockId; use alloy_rpc_types_trace::parity::LocalizedTransactionTrace; use jsonrpsee::core::{async_trait, RpcResult}; use revm_inspectors::tracing::...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/debug_rpc.rs
src/eth_rpc/servers/debug_rpc.rs
use crate::{eth_rpc::api::debug_api::DebugApiServer, providers::debug_provider::DebugProvider}; use alloy_primitives::{Bytes, B256}; use alloy_rpc_types::{BlockId, BlockNumberOrTag, TransactionRequest}; use alloy_rpc_types_trace::geth::{GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult}; use ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/txpool_rpc.rs
src/eth_rpc/servers/txpool_rpc.rs
use crate::{ eth_rpc::api::txpool_api::TxPoolApiServer, providers::{eth_provider::database::types::transaction::ExtendedTransaction, pool_provider::PoolProvider}, }; use alloy_primitives::Address; use alloy_rpc_types_txpool::{TxpoolContent, TxpoolContentFrom, TxpoolInspect, TxpoolStatus}; use jsonrpsee::core::{...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/eth_rpc.rs
src/eth_rpc/servers/eth_rpc.rs
use crate::{ client::{EthClient, TransactionHashProvider}, eth_rpc::api::eth_api::EthApiServer, providers::eth_provider::{ constant::MAX_PRIORITY_FEE_PER_GAS, database::types::{header::ExtendedBlock, receipt::ExtendedTxReceipt, transaction::ExtendedTransaction}, error::EthApiError, ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/mod.rs
src/eth_rpc/servers/mod.rs
pub mod alchemy_rpc; pub mod debug_rpc; pub mod eth_rpc; pub mod kakarot_rpc; pub mod net_rpc; pub mod trace_rpc; pub mod txpool_rpc; pub mod web3_rpc;
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/kakarot_rpc.rs
src/eth_rpc/servers/kakarot_rpc.rs
use crate::{ config::KakarotRpcConfig, eth_rpc::api::kakarot_api::KakarotApiServer, providers::eth_provider::{ constant::{Constant, MAX_LOGS}, starknet::kakarot_core::{get_white_listed_eip_155_transaction_hashes, MAX_FELTS_IN_CALLDATA}, }, }; use jsonrpsee::core::{async_trait, RpcResult}...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/alchemy_rpc.rs
src/eth_rpc/servers/alchemy_rpc.rs
use crate::{ eth_rpc::api::alchemy_api::AlchemyApiServer, models::token::{TokenBalances, TokenMetadata}, providers::alchemy_provider::AlchemyProvider, }; use alloy_primitives::{Address, U256}; use async_trait::async_trait; use jsonrpsee::core::RpcResult; /// The RPC module for the Ethereum protocol require...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/web3_rpc.rs
src/eth_rpc/servers/web3_rpc.rs
use crate::eth_rpc::api::web3_api::Web3ApiServer; use alloy_primitives::{keccak256, Bytes, B256}; use jsonrpsee::core::{async_trait, RpcResult}; /// The RPC module for the implementing Web3 Api { i.e rpc endpoints prefixed with web3_ } #[derive(Default, Debug)] pub struct Web3Rpc {} impl Web3Rpc { pub const fn ne...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/eth_rpc/servers/net_rpc.rs
src/eth_rpc/servers/net_rpc.rs
use crate::{eth_rpc::api::net_api::NetApiServer, providers::eth_provider::provider::EthereumProvider}; use alloy_primitives::U64; use jsonrpsee::core::{async_trait, RpcResult}; /// The RPC module for the implementing Net api #[derive(Debug)] pub struct NetRpc<P: EthereumProvider> { eth_provider: P, } impl<P: Ethe...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/client/mod.rs
src/client/mod.rs
use crate::{ constants::{ETH_CHAIN_ID, KKRT_BLOCK_GAS_LIMIT}, pool::{ mempool::{KakarotPool, TransactionOrdering}, validate::KakarotTransactionValidatorBuilder, }, providers::{ eth_provider::{ database::{ filter, filter::EthDatabaseFilt...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/prometheus_handler/mod.rs
src/prometheus_handler/mod.rs
// This file is part of Substrate. // Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.a...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/tx_waiter.rs
src/test_utils/tx_waiter.rs
use anyhow::Result; use starknet::{ core::types::{ExecutionResult, Felt, StarknetError}, providers::{Provider, ProviderError}, }; use std::time::Duration; use tracing::info; /// Code taken from /// <https://github.com/xJonathanLEI/starkli/blob/42c7cfc42102e399f76896ebbbc5291393f40d7e/src/utils.rs#L13> /// Cred...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/evm_contract.rs
src/test_utils/evm_contract.rs
use super::eoa::{TX_GAS_LIMIT, TX_GAS_PRICE}; use crate::{models::felt::Felt252Wrapper, root_project_path}; use alloy_consensus::{TxEip1559, TxLegacy}; use alloy_dyn_abi::{DynSolValue, JsonAbiExt}; use alloy_json_abi::ContractObject; use alloy_primitives::{TxKind, U256}; use foundry_config::{find_project_root, load_con...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/fixtures.rs
src/test_utils/fixtures.rs
use rstest::fixture; use tracing_subscriber::{filter, FmtSubscriber}; #[cfg(any(test, feature = "arbitrary", feature = "testing"))] use { super::katana::Katana, super::mongo::RANDOM_BYTES_SIZE, crate::test_utils::evm_contract::KakarotEvmContract, alloy_dyn_abi::DynSolValue, alloy_primitives::{Addres...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/macros.rs
src/test_utils/macros.rs
/// Macro to find the root path of the project. /// /// This macro utilizes the `find_project_root_path` function from the `utils` module. /// This function works by identifying the root directory of the current git repository. /// It starts at the current working directory and traverses up the directory tree until it ...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/mod.rs
src/test_utils/mod.rs
pub mod constants; pub mod eoa; pub mod evm_contract; pub mod fixtures; pub mod hive; pub mod katana; pub mod macros; pub mod mock_provider; pub mod mongo; pub mod rpc; pub mod tx_waiter;
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/eoa.rs
src/test_utils/eoa.rs
use crate::{ client::{EthClient, KakarotTransactions}, into_via_try_wrapper, providers::eth_provider::{ starknet::{kakarot_core::starknet_address, relayer::Relayer}, ChainProvider, TransactionProvider, }, test_utils::{ evm_contract::{EvmContract, KakarotEvmContract, Transacti...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/mock_provider.rs
src/test_utils/mock_provider.rs
use crate::providers::eth_provider::{ database::types::{header::ExtendedBlock, receipt::ExtendedTxReceipt, transaction::ExtendedTransaction}, provider::EthApiResult, BlockProvider, ChainProvider, GasProvider, LogProvider, ReceiptProvider, StateProvider, TransactionProvider, }; use alloy_eips::{BlockId, Bloc...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/constants.rs
src/test_utils/constants.rs
pub const ACCOUNT_EVM_ADDRESS: &str = "Account_evm_address"; pub const ACCOUNT_IMPLEMENTATION: &str = "Account_implementation"; pub const ACCOUNT_NONCE: &str = "Account_nonce"; pub const ACCOUNT_STORAGE: &str = "Account_storage"; pub const OWNABLE_OWNER: &str = "Ownable_owner"; pub const ACCOUNT_CAIRO1_HELPERS_CLASS_HA...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/katana/genesis.rs
src/test_utils/katana/genesis.rs
use crate::{ providers::eth_provider::utils::split_u256, test_utils::constants::{ ACCOUNT_AUTHORIZED_MESSAGE_HASHES, ACCOUNT_CAIRO1_HELPERS_CLASS_HASH, ACCOUNT_EVM_ADDRESS, ACCOUNT_IMPLEMENTATION, EIP_155_AUTHORIZED_MESSAGE_HASHES, KAKAROT_ACCOUNT_CONTRACT_CLASS_HASH, KAKAROT_BASE_FEE, K...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/katana/mod.rs
src/test_utils/katana/mod.rs
pub mod genesis; use super::mongo::MongoImage; use crate::{ client::EthClient, constants::KKRT_BLOCK_GAS_LIMIT, providers::eth_provider::{ constant::U64_HEX_STRING_LEN, database::{ ethereum::EthereumTransactionStore, filter::{self, format_hex, EthDatabaseFilterBuilde...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/rpc/mod.rs
src/test_utils/rpc/mod.rs
use super::katana::Katana; use crate::eth_rpc::{config::RPCConfig, rpc::KakarotRpcModuleBuilder, run_server}; use jsonrpsee::server::ServerHandle; use serde::{Deserialize, Serialize}; use serde_json::Value; use std::net::SocketAddr; /// Sets up the environment for Kakarot RPC integration tests by deploying the Kakarot...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/hive/mod.rs
src/test_utils/hive/mod.rs
use super::{ constants::{ ACCOUNT_CAIRO1_HELPERS_CLASS_HASH, ACCOUNT_IMPLEMENTATION, KAKAROT_EVM_TO_STARKNET_ADDRESS, OWNABLE_OWNER, }, katana::genesis::{KatanaGenesisBuilder, Loaded}, }; use account::{Account, KakarotAccount}; use alloy_primitives::{Address, Bytes, B256, U256, U64}; use katana_prim...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/hive/account.rs
src/test_utils/hive/account.rs
#![allow(unreachable_pub)] use crate::providers::eth_provider::utils::split_u256; use alloy_consensus::constants::KECCAK_EMPTY; use alloy_primitives::{keccak256, Address, Bytes, U256}; use revm_interpreter::analysis::to_analysed; use revm_primitives::Bytecode; use starknet::core::utils::get_storage_var_address; use sta...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/src/test_utils/mongo/mod.rs
src/test_utils/mongo/mod.rs
use crate::providers::eth_provider::{ constant::U64_HEX_STRING_LEN, database::{ types::{ header::StoredHeader, log::StoredLog, receipt::{ExtendedTxReceipt, StoredTransactionReceipt}, transaction::StoredTransaction, }, CollectionName, Databa...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/entry.rs
tests/entry.rs
//! In order to avoid generating multiple separate test crates, //! we use a single entry point for all tests. Provides better //! performance in testing. pub mod tests;
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/debug_api.rs
tests/tests/debug_api.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use alloy_eips::eip2718::{Decodable2718, Encodable2718}; use alloy_primitives::Bytes; use alloy_rlp::Encodable; use alloy_rpc_types::TransactionInfo; use alloy_serde::WithOtherFields; use kakarot_rpc::{ client::TransactionHashProvider, prov...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/kakarot_api.rs
tests/tests/kakarot_api.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use alloy_primitives::B256; use kakarot_rpc::{ providers::eth_provider::constant::Constant, test_utils::{ fixtures::{katana, setup}, katana::Katana, rpc::{start_kakarot_rpc_server, RawRpcParamsBuilder}, }, }; us...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/alchemy_api.rs
tests/tests/alchemy_api.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use alloy_dyn_abi::DynSolValue; use alloy_primitives::{address, Address, U256}; use kakarot_rpc::{ models::{ felt::Felt252Wrapper, token::{TokenBalances, TokenMetadata}, }, test_utils::{ eoa::Eoa as _, e...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/tracer.rs
tests/tests/tracer.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use alloy_consensus::Transaction; use alloy_dyn_abi::DynSolValue; use alloy_primitives::{Address, Bytes, B256, B64, U256}; use alloy_rpc_types_trace::{ geth::{GethDebugTracingOptions, GethTrace, TraceResult}, parity::{Action, CallAction, Ca...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/txpool_api.rs
tests/tests/txpool_api.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use crate::tests::mempool::create_sample_transactions; use alloy_consensus::Transaction; use alloy_rpc_types_txpool::{TxpoolContent, TxpoolContentFrom, TxpoolInspect, TxpoolInspectSummary, TxpoolStatus}; use jsonrpsee::server::ServerHandle; use kak...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/eth_provider.rs
tests/tests/eth_provider.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use crate::tests::mempool::create_sample_transactions; use alloy_consensus::{TxEip1559, TxLegacy}; use alloy_eips::{eip2718::Encodable2718, BlockNumberOrTag}; use alloy_primitives::{address, bytes, Address, Bytes, Signature, TxKind, B256, U256, U64...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
true
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/mod.rs
tests/tests/mod.rs
pub mod alchemy_api; pub mod debug_api; pub mod eth_provider; pub mod kakarot_api; pub mod mempool; pub mod trace_api; pub mod tracer; pub mod txpool_api;
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/mempool.rs
tests/tests/mempool.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use alloy_consensus::{TxEip1559, EMPTY_ROOT_HASH}; use alloy_eips::eip2718::Encodable2718; use alloy_primitives::{Address, TxKind, B64, U256}; use alloy_rpc_types::Header; use kakarot_rpc::{ constants::KKRT_BLOCK_GAS_LIMIT, pool::mempool::m...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
kkrt-labs/kakarot-rpc
https://github.com/kkrt-labs/kakarot-rpc/blob/6b48598a85bb2598123e1be7237da9832d0d5eaa/tests/tests/trace_api.rs
tests/tests/trace_api.rs
#![allow(clippy::used_underscore_binding)] #![cfg(feature = "testing")] use alloy_consensus::Transaction; use alloy_dyn_abi::DynSolValue; use alloy_eips::BlockId; use alloy_primitives::{Address, TxKind, B256, U256}; use alloy_rpc_types::{request::TransactionInput, TransactionRequest}; use alloy_rpc_types_trace::geth::{...
rust
MIT
6b48598a85bb2598123e1be7237da9832d0d5eaa
2026-01-04T20:20:26.112976Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/lib.rs
src/lib.rs
//! libracerd provides an http server and set of completion engines for consumption by rust //! developer tools. The http server itself is a few JSON endpoints providing completion, definition //! look-up, and compilation. The endpoints are backed by an object implementing `SemanticEngine` //! //! Documentation for the...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/util/fs.rs
src/util/fs.rs
//! fs utilities (eg. TmpFile) use rand::distributions::Alphanumeric; use std::convert::From; use std::fs::{self, File}; use std::io::Write; use std::path::{Path, PathBuf}; use std::thread; /// A temporary file that is removed on drop /// /// With the new constructor, you provide contents and a file is created based o...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/util/mod.rs
src/util/mod.rs
//! Som misc shared functionality pub mod fs;
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/bin/racerd.rs
src/bin/racerd.rs
extern crate docopt; extern crate env_logger; extern crate libracerd; #[macro_use] extern crate serde_derive; use libracerd::engine::SemanticEngine; use libracerd::{engine, http, Config}; use std::convert::Into; use docopt::Docopt; const VERSION: &str = env!("CARGO_PKG_VERSION"); const USAGE: &str = " racerd - a JS...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/engine/my_racer.rs
src/engine/my_racer.rs
//! SemanticEngine implementation for [the racer library](https://github.com/phildawes/racer) //! use crate::engine::{Completion, Context, CursorPosition, Definition, SemanticEngine}; use racer::{self, Coordinate, FileCache, Match, Session}; use std::sync::Mutex; use regex::Regex; pub struct Racer { cache: Mute...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/engine/error.rs
src/engine/error.rs
use std::error; use std::fmt; use std::io; /// Error type for semantic engine module #[derive(Debug)] pub enum Error { IoError(io::Error), Racer, } impl error::Error for Error { fn description(&self) -> &str { match *self { Error::IoError(_) => "io::Error during engine operation", ...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/engine/mod.rs
src/engine/mod.rs
use std::path::Path; /// This module's Error and Result types mod error; pub use self::error::{Error, Result}; use crate::Config; /// Provide completions, definitions, and analysis of rust source code pub trait SemanticEngine: Send + Sync { /// Perform any necessary initialization. /// /// Only needs to ...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/http/completion.rs
src/http/completion.rs
use iron::mime::Mime; use iron::prelude::*; use iron::status; use serde_json::to_string; use super::EngineProvider; use crate::engine::{Buffer, Completion, Context, CursorPosition}; /// Given a location, return a list of possible completions pub fn list(req: &mut Request) -> IronResult<Response> { let lcr = matc...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/http/ping.rs
src/http/ping.rs
use iron::prelude::*; use iron::status; /// Check if the server is accepting requests pub fn pong(_: &mut Request) -> IronResult<Response> { Ok(Response::with((status::Ok, "{\"pong\": true}"))) }
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/http/file.rs
src/http/file.rs
use iron::prelude::*; /// Parse a file and return a list of issues (warnings, errors) encountered pub fn parse(_: &mut Request) -> IronResult<Response> { unimplemented!(); }
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/http/mod.rs
src/http/mod.rs
//! http server for semantic engines use iron::prelude::*; use crate::Config; mod completion; mod definition; mod file; mod ping; use crate::engine::SemanticEngine; use iron::typemap::Key; use iron_hmac::Hmac256Authentication; use iron_hmac::SecretKey; use std::sync::{Arc, Mutex}; /// Errors occurring in the http...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/src/http/definition.rs
src/http/definition.rs
use iron::mime::Mime; use iron::prelude::*; use iron::status; use serde_json::to_string; use super::EngineProvider; use crate::engine::{Buffer, Context, CursorPosition, Definition}; /// Given a location, return where the identifier is defined /// /// Possible responses include /// /// - `200 OK` the request was succ...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/tests/lib.rs
tests/lib.rs
#![deny(warnings)] extern crate libracerd; extern crate rustc_serialize; #[macro_use] extern crate hyper; extern crate crypto; mod util; /// Although the value is not used, running env! for RUST_SRC_PATH checks, before running the tests, /// that the required environment variable is defined. const _RUST_SRC_PATH: ...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/tests/util/http.rs
tests/util/http.rs
use std::fs::File; use std::io::{Read, Write}; use std::ops::Deref; use libracerd::engine::{Racer, SemanticEngine}; use libracerd::Config; use hyper::method::Method; /// Smart pointer for libracerd http server. /// /// TestServer automatically closes the underlying server when going out of scope. pub struct TestServ...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
jwilm/racerd
https://github.com/jwilm/racerd/blob/e3d380b9a1d3f3b67286d60465746bc89fea9098/tests/util/mod.rs
tests/util/mod.rs
use rustc_serialize::hex::ToHex; use crypto::hmac::Hmac; use crypto::mac::Mac; use crypto::sha2::Sha256; #[macro_use] pub mod http; pub fn hmac256(secret: &[u8], data: &[u8]) -> Vec<u8> { let mut hmac = Hmac::new(Sha256::new(), secret); let len = hmac.output_bytes(); let mut result = Vec::with_capacity(...
rust
Apache-2.0
e3d380b9a1d3f3b67286d60465746bc89fea9098
2026-01-04T20:20:43.736802Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/tools/benchmarks/3em/evm.rs
tools/benchmarks/3em/evm.rs
use three_em_arweave::arweave::Arweave; use three_em_arweave::cache::ArweaveCache; use three_em_arweave::cache::CacheExt; use three_em_executor::execute_contract; #[tokio::main] async fn main() { let arweave = Arweave::new( 443, "arweave.net".to_string(), String::from("https"), ArweaveCache::new(), ...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/tools/benchmarks/3em/js_mem.rs
tools/benchmarks/3em/js_mem.rs
use std::time::Instant; use three_em_arweave::arweave::Arweave; use three_em_arweave::cache::CacheExt; use three_em_arweave::lru_cache::ArweaveLruCache; use three_em_executor::execute_contract; #[tokio::main] async fn main() { let arweave = Arweave::new( 443, "arweave.net".to_string(), String::from("http...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/tools/benchmarks/3em/main_fh.rs
tools/benchmarks/3em/main_fh.rs
use three_em_arweave::arweave::Arweave; use three_em_arweave::cache::ArweaveCache; use three_em_arweave::cache::CacheExt; use three_em_executor::execute_contract; #[tokio::main] async fn main() { let arweave = Arweave::new( 443, "arweave.net".to_string(), String::from("https"), ArweaveCache::new(), ...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/tools/benchmarks/3em/main.rs
tools/benchmarks/3em/main.rs
use three_em_arweave::arweave::Arweave; use three_em_arweave::cache::ArweaveCache; use three_em_arweave::cache::CacheExt; use three_em_executor::execute_contract; #[tokio::main] async fn main() { let arweave = Arweave::new( 443, "arweave.net".to_string(), String::from("https"), ArweaveCache::new(), ...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/tools/benchmarks/3em/wasm.rs
tools/benchmarks/3em/wasm.rs
use three_em_arweave::arweave::Arweave; use three_em_arweave::cache::ArweaveCache; use three_em_arweave::cache::CacheExt; use three_em_executor::execute_contract; #[tokio::main] async fn main() { let arweave = Arweave::new( 443, "arweave.net".to_string(), String::from("https"), ArweaveCache::new(), ...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/benches/wasm.rs
benches/wasm.rs
#[macro_use] extern crate three_em; use std::cell::Cell; use three_em::runtime::smartweave::ContractInfo; use criterion::black_box; use criterion::criterion_group; use criterion::criterion_main; use criterion::Criterion; use deno_core::serde_json; use deno_core::serde_json::json; use std::time::Duration; use three_em...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/wasm_tools/rust/src/lib.rs
wasm_tools/rust/src/lib.rs
use std::panic; pub use three_em_macro::*; pub mod alloc; #[link(wasm_import_module = "3em")] extern "C" { fn throw_error(ptr: *const u8, len: usize); } #[no_mangle] pub fn panic_hook(info: &panic::PanicInfo) { let payload = info.payload(); let payload_str = match payload.downcast_ref::<&str>() { Some(s) =...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/wasm_tools/rust/src/alloc.rs
wasm_tools/rust/src/alloc.rs
//! Allocator APIs exposed to the host. use ::std::alloc::alloc; use ::std::alloc::dealloc; use ::std::alloc::Layout; use ::std::mem::align_of; #[no_mangle] pub unsafe fn contract_alloc(len: usize) -> *mut u8 { let align = align_of::<usize>(); let layout = Layout::from_size_align_unchecked(len, align); alloc(lay...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/wasm_tools/rust/proc_macro/src/lib.rs
wasm_tools/rust/proc_macro/src/lib.rs
use proc_macro::TokenStream; use syn::ItemFn; use quote::quote; #[proc_macro_attribute] pub fn handler(_attr: TokenStream, input: TokenStream) -> TokenStream { let func = syn::parse::<ItemFn>(input).unwrap(); let fn_inputs = &func.sig.inputs; let fn_output = &func.sig.output; let fn_generics = &func.sig.gener...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/wasm_tools/rust/example/contract.rs
wasm_tools/rust/example/contract.rs
use serde::Deserialize; use serde::Serialize; use three_em::handler; #[derive(Serialize, Deserialize)] pub struct State { counter: i32, } #[derive(Deserialize)] pub struct Action {} #[handler] pub fn handle(state: State, _action: Action) -> State { State { counter: state.counter + 1, } }
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/js/evm/lib.rs
js/evm/lib.rs
use evm::Instruction; use evm::Machine; use evm::U256; use std::alloc::Layout; fn dummy_cost_fn(_: &Instruction) -> U256 { U256::zero() } #[no_mangle] pub extern "C" fn machine_new() -> *mut Machine<'static> { Box::into_raw(Box::new(Machine::new(dummy_cost_fn))) } #[no_mangle] pub extern "C" fn machine_new_with_...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/js/napi/build.rs
js/napi/build.rs
fn main() { napi_build::setup(); }
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/js/napi/src/lib.rs
js/napi/src/lib.rs
use napi::bindgen_prelude::*; use napi::sys::{napi_env, napi_value}; use napi_derive::napi; use serde_json::Value; use std::collections::HashMap; use std::panic; use three_em_arweave::arweave::{Arweave, ManualLoadedContract}; use three_em_arweave::cache::ArweaveCache; use three_em_arweave::cache::CacheExt; use three_em...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
true
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/evm/lib.rs
crates/evm/lib.rs
pub use primitive_types::H128; pub use primitive_types::U256; use tiny_keccak::Hasher; use tiny_keccak::Keccak; pub mod storage; pub use storage::Storage; macro_rules! repr_u8 { ($(#[$meta:meta])* $vis:vis enum $name:ident { $($(#[$vmeta:meta])* $vname:ident $(= $val:expr)?,)* }) => { $(#[$meta])* ...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
true
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/evm/storage.rs
crates/evm/storage.rs
// Contract storage use primitive_types::U256; use std::collections::HashMap; macro_rules! extend_u256 { ($vec:ident, $val:expr) => { let array: [u8; 32] = $val.into(); $vec.extend_from_slice(&array); }; } #[derive(Debug, Clone)] pub struct Storage { pub inner: HashMap<U256, HashMap<U256, U256>>, } ///...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/arweave/lib.rs
crates/arweave/lib.rs
pub mod arweave; pub mod cache; pub mod gql_result; pub mod lru_cache; pub mod miscellaneous; mod utils;
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/arweave/utils.rs
crates/arweave/utils.rs
use crate::gql_result::GQLNodeInterface; use sha2::Digest; pub fn decode_base_64(data: String) -> String { String::from_utf8(base64::decode(data).unwrap_or_else(|_| vec![])) .unwrap_or_else(|_| String::from("")) } pub fn hasher(data: &[u8]) -> Vec<u8> { let mut hasher = sha2::Sha256::new(); hasher.update(da...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/arweave/gql_result.rs
crates/arweave/gql_result.rs
use serde::Deserialize; use serde::Serialize; #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct GQLPageInfoInterface { pub has_next_page: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct GQLOwnerInterface { pub address: String, #[serde(skip_serializi...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/arweave/miscellaneous.rs
crates/arweave/miscellaneous.rs
use crate::arweave::TransactionData; use crate::utils::hasher; use deno_core::error::AnyError; use serde::Deserialize; use serde::Serialize; pub type CommonError = AnyError; #[derive(Deserialize, Serialize, Clone, Debug, Default)] pub enum ContractType { #[default] JAVASCRIPT, WASM, EVM, } // impl Default fo...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/arweave/arweave.rs
crates/arweave/arweave.rs
use crate::cache::CacheExt; use crate::gql_result::GQLNodeParent; use crate::gql_result::GQLResultInterface; use crate::gql_result::GQLTransactionsResultInterface; use crate::gql_result::{GQLBundled, GQLEdgeInterface}; use crate::miscellaneous::ContractType; use crate::miscellaneous::{get_contract_type, get_contract_ty...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/arweave/cache.rs
crates/arweave/cache.rs
use crate::arweave::LoadedContract; use crate::gql_result::GQLEdgeInterface; use deno_core::serde_json::Value; use indexmap::map::IndexMap; use serde::{Deserialize, Serialize}; use std::fmt::Debug; use std::fs::{create_dir_all, remove_file, File}; use std::io::BufReader; use std::path::PathBuf; pub trait CacheExt: Deb...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/arweave/lru_cache.rs
crates/arweave/lru_cache.rs
use crate::arweave::LoadedContract; use crate::cache::CacheExt; use crate::cache::StateResult; use crate::gql_result::GQLEdgeInterface; use lru::LruCache; #[derive(Debug)] pub struct ArweaveLruCache { contracts: LruCache<String, LoadedContract>, interactions: LruCache<String, Vec<GQLEdgeInterface>>, states: LruC...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/wasm/lib.rs
crates/wasm/lib.rs
use deno_core::error::AnyError; use deno_core::serde_json::Value; use deno_core::JsRuntime; use deno_core::RuntimeOptions; use std::cell::Cell; use three_em_js::{snapshot, Error}; use three_em_smartweave::{read_contract_state, InteractionContext}; macro_rules! wasm_alloc { ($scope: expr, $alloc: expr, $this: expr, $...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/exm/lib.rs
crates/exm/lib.rs
use deno_core::error::AnyError; use deno_core::include_js_files; use deno_ops::op; use deno_core::serde::{Deserialize, Serialize}; use deno_core::serde_json::Value; use deno_core::Extension; use deno_core::OpState; use deno_core::ZeroCopyBuf; use std::cell::RefCell; use std::collections::HashMap; use std::future::Futu...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/metering/lib.rs
crates/metering/lib.rs
#![allow(unused_assignments)] use std::borrow::Cow; use wasm_encoder::BlockType; use wasm_encoder::CodeSection; use wasm_encoder::ElementSection; use wasm_encoder::EntityType; use wasm_encoder::Function; use wasm_encoder::ImportSection; pub use wasm_encoder::Instruction; use wasm_encoder::MemArg; use wasm_encoder::Mod...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
true
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/js/lib.rs
crates/js/lib.rs
pub mod default_permissions; mod loader; pub mod snapshot; use crate::default_permissions::Permissions; use crate::loader::EmbeddedModuleLoader; use deno_core::error::{generic_error, AnyError}; use deno_core::serde::de::DeserializeOwned; use deno_core::serde::Serialize; use deno_core::serde_json::Value; use deno_core:...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
true
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/js/build.rs
crates/js/build.rs
pub mod default_permissions; use crate::default_permissions::Permissions; use deno_core::error::AnyError; use deno_core::serde_json::Value; use deno_core::JsRuntime; use deno_core::OpState; use deno_core::RuntimeOptions; use deno_fetch::Options; use deno_ops::op; use deno_web::BlobStore; use std::cell::RefCell; use st...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/js/loader.rs
crates/js/loader.rs
use deno_core::error::type_error; use deno_core::error::AnyError; use deno_core::futures::FutureExt; use deno_core::ModuleLoader; use deno_core::ModuleSpecifier; use deno_core::ModuleType; use std::pin::Pin; pub struct EmbeddedModuleLoader(pub String, pub String); impl ModuleLoader for EmbeddedModuleLoader { fn re...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/js/default_permissions.rs
crates/js/default_permissions.rs
use deno_core::OpState; use std::path::Path; pub struct Permissions; impl deno_web::TimersPermission for Permissions { fn allow_hrtime(&mut self) -> bool { true } fn check_unstable(&self, state: &OpState, api_name: &'static str) {} } impl deno_fetch::FetchPermissions for Permissions { fn check_net_url( ...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/js/snapshot.rs
crates/js/snapshot.rs
use deno_core::Snapshot; pub static CLI_SNAPSHOT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.bin")); pub fn snapshot() -> Snapshot { let data = CLI_SNAPSHOT; Snapshot::Static(data) }
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/smartweave/lib.rs
crates/smartweave/lib.rs
use deno_core::error::AnyError; use deno_core::include_js_files; use deno_core::OpDecl; use deno_ops::op; use deno_core::serde::Serialize; use deno_core::serde_json::Value; use deno_core::Extension; use deno_core::OpState; use deno_core::ZeroCopyBuf; use std::cell::RefCell; use std::collections::HashMap; use std::futu...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
false
three-em/3em
https://github.com/three-em/3em/blob/3c0ffd8ad90850c5bb226b672bcbe2aba0b76228/crates/executor/lib.rs
crates/executor/lib.rs
pub mod executor; pub mod test_util; pub mod utils; pub use crate::executor::ExecuteResult; pub use crate::executor::ValidityTable; use crate::executor::{raw_execute_contract, V8Result}; use deno_core::error::{generic_error, AnyError}; use deno_core::serde_json::Value; pub use indexmap::map::IndexMap; use lru::LruCach...
rust
MIT
3c0ffd8ad90850c5bb226b672bcbe2aba0b76228
2026-01-04T20:20:32.953016Z
true