Skip to content

update: Motoko examples README #1228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
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
36 changes: 3 additions & 33 deletions motoko/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
# Motoko examples

## Standalone Motoko
These examples demonstrate the use of Motoko as a backend language on the ICP platform.

These examples show the Motoko language as a backend language for the IC, operating directly with clients, without a front end component.
## Security considerations and security best practices

### Basic

- [`counter`](https://github.com/dfinity/examples/tree/master/motoko/counter) -- basic (stable) variable demo.
- [`hello_cycles`](https://github.com/dfinity/examples/tree/master/motoko/hello_cycles) -- basic cycles demo.
- [`who_am_i`](https://github.com/dfinity/examples/tree/master/motoko/who_am_i) -- basic caller identification demo.

### Intermediate

- [`classes`](https://github.com/dfinity/examples/tree/master/motoko/classes) -- dynamic actor (class) instantiation.
- [`pub-sub`](https://github.com/dfinity/examples/tree/master/motoko/pub-sub) -- multiple canisters, with publisher-subscriber inter-canister calls.
- [`icrc2-swap`](https://github.com/dfinity/examples/tree/master/motoko/icrc2-swap) -- deposit, swap, and withdraw two ICRC-2 tokens.

## Minimal front end.

These examples use a minimal front end component.

- [`random_maze`](https://github.com/dfinity/examples/tree/master/motoko/random_maze) -- random maze generation, with IC-based randomness.
- [`cert_var`](https://github.com/dfinity/examples/tree/master/motoko/cert-var) -- simple certified variable (a single 32-bit number), with client-side certificate validation.
- [`minimal-counter-dapp`](https://github.com/dfinity/examples/tree/master/motoko/minimal-counter-dapp) -- counter dapp with minimal front end.


## Full stack.

These examples use a "conventional" front end component (via `React.Component`).

- [`life`](https://github.com/dfinity/examples/tree/master/motoko/life) -- demonstrates upgrades among three versions and stable state migration.
- [`superheroes`](https://github.com/dfinity/examples/tree/master/motoko/superheroes) -- CRUD-like demo service.

## Security Considerations and Security Best Practices

If you base your application on one of these examples, we recommend you familiarize yourself with and adhere to the [Security Best Practices](https://internetcomputer.org/docs/current/references/security/) for developing on the Internet Computer. The examples provided here may not implement all the best practices.
If you base your application on one of these examples, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/building-apps/security/overview) for developing on the Internet Computer. The examples provided here may not implement all the best practices.