Skip to content

Commit

Permalink
Merge branch 'master' into update-sidebars
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiemongeon1 authored Dec 17, 2024
2 parents 4f5f115 + 8be2c35 commit 422c65c
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 537 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ keywords: [intermediate, tokens, tutorial, ledger]
---

import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# ICP ledger local setup

Expand Down Expand Up @@ -232,4 +234,4 @@ Or, you can interact with it using the Candid UI by navigating to the URL provid

```
http://127.0.0.1:4943/?canisterId=bnz7o-iuaaa-aaaaa-qaaaa-cai&id=ryjl3-tyaaa-aaaaa-aaaba-cai
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ keywords: [intermediate, tokens, icrc, tutorial, ledger]
---

import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# ICRC-1 ledger local setup

Expand Down Expand Up @@ -84,4 +86,4 @@ There is a test suite available for [ICRC-1 ledgers](https://github.com/dfinity/

## Next steps

Before you deploy your ledger canister, you will need to set some variables that you will pass to the canister during initialization that will create a new ICRC-1 or ICRC-2 token. To learn how to set these variables and deploy the ledger canister, see [create a token](/docs/developer-docs/defi/tokens/create.mdx).
Before you deploy your ledger canister, you will need to set some variables that you will pass to the canister during initialization that will create a new ICRC-1 or ICRC-2 token. To learn how to set these variables and deploy the ledger canister, see [create a token](/docs/developer-docs/defi/tokens/create.mdx).
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,65 @@ dfx canister call evm_rpc eth_getTransactionReceipt "(variant {$RPC_SOURCE}, $RP
<AdornedTabs groupId="languages">
<TabItem value="motoko" label="Motoko" default>

Calling an Ethereum smart contract from Motoko is possible but not yet officially supported.
```motoko no-repl
import EvmRpc "canister:evm_rpc";
import Cycles "mo:base/ExperimentalCycles";
import Debug "mo:base/Debug";
actor {
public func call() : async ?Text {
// Configure RPC request
let services = #EthMainnet(null);
let config = null;
// Add cycles to next call
Cycles.add<system>(2000000000);
// Call an Ethereum smart contract. The smart contract's information in this example is hard coded.
let result = await EvmRpc.eth_call(services, config, {
block = null;
transaction = {
to = ?"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
input = ?"0x70a08231000000000000000000000000b25eA1D493B49a1DeD42aC5B1208cC618f9A9B80"; // ABI-encoded
accessList = null;
blobVersionedHashes = null;
blobs = null;
chainId = null;
from = null;
gas = null;
gasPrice = null;
maxFeePerBlobGas = null;
maxFeePerGas = null;
maxPriorityFeePerGas = null;
nonce = null;
type_ = null;
value = null
};
});
// Process results
switch result {
// Prints the response if each RPC provider returns a consistent, successful result
case (#Consistent(#Ok response)) {
Debug.print("Success: " # debug_show response);
?response // ABI-encoded
};
// Trap is an RPC provider returns an error message consistent with the response of the other providers
case (#Consistent(#Err error)) {
Debug.trap("Error: " # debug_show error);
null
};
// Trap if an RPC provider returns a response inconsistent with the other providers
case (#Inconsistent(_results)) {
Debug.trap("Inconsistent results");
null
};
};
};
};
```

</TabItem>
<TabItem value="rust" label="Rust">
Expand Down
145 changes: 0 additions & 145 deletions docs/developer-docs/web-apps/application-frontends/add-stylesheet.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,3 @@ If you are using an older version of `dfx`, we recommend updating your security
## Resources

- [Asset canister architecture reference](/docs/current/references/asset-canister).

## Next steps

[Learn more about webpack](webpack.mdx).

Loading

0 comments on commit 422c65c

Please sign in to comment.