Crates.io | ic-evm-utils |
lib.rs | ic-evm-utils |
version | 3.2.0 |
source | src |
created_at | 2024-06-26 10:20:46.694298 |
updated_at | 2024-09-17 09:07:55.447102 |
description | Utils for interacting with Ethereum from ICP canisters. |
homepage | https://github.com/letmejustputthishere/chain-fusion-starter |
repository | https://github.com/letmejustputthishere/chain-fusion-starter |
max_upload_size | |
id | 1284384 |
size | 32,941 |
evm_signer
: a module that provides a way to sign messages using the t-ECDSA and get the public key and EVM address of the signerfees
: a module that provides a way to calculate the fees for a given transactionconversions
: some helpful functions to convert between different types commonly used by the ethers crateeth_call
: a module that provides a way to call a smart contract function without modifying the state of the EVM, this is useful for reading data from the EVM and achieved by calling the request
EVM RPC functionerc20_balance_of
built on top of eth_call
to get the balance of an ERC20 tokeneth_send_raw_transaction
: a module that provides a way to send a signed transaction to the EVM, this is useful for modifying the state of the EVM and achieved by calling the send_raw_transaction
EVM RPC functiontransfer_eth
and contract_interaction
functions built on top of eth_send_raw_transaction
to send ETH and interact with smart contractsrequest
: a module that provides a way to make arbitrary RPC requests, includes determening the cycles costs of the requestrequest_costs
: a module that provides a way to calculate the cycles costs of a given RPC requestEvmRpcCanister
struct to make inter canister calls to the EVM RPC canister, this struct is used to initiate calls to the EVM RPC Canister
evm-rpc-canister-types
crate to create this struct[dependencies]
ic-evm-utils= 0.1
EvmRpcCanister
struct to the functions if necessary
use ic_evm_utils::eth_send_raw_transaction::{contract_interaction, ContractDetails};
// ...
let status = contract_interaction(
contract_details,
gas,
rpc_services,
nonce,
key_id,
vec![],
EVM_RPC, // EvmRpcCanister struct
)
.await;