How I Built a Token Transfer Task with Mimic in 5 Steps
Mimic, a cross-chain DeFi automation layer, first landed on my radar through an unexpected chain of events at DevConnect BA 2025.
Getting settled at the #uniswapcup
— Rashid McMoodoo (@mcmoodoo) November 16, 2025
Will be playing on the notorious Atrium Academy’s team pic.twitter.com/PwXW9AZdY3
I’d joined the Uniswap Hooks Incubator run by Atrium Academy, which earned me a spot on their Uniswap Cup team. That got me dropped into a chaotic Telegram group where players debated everything from cleat length to ball size. Since I was trying to get the attention of top DeFi teams, I fired off a deliberately bold message to shake things up:

Entertained by my punchy message, Pandit followed up and pointed me to Lukasz from Mimic, who quickly gave me a rundown of their three-layer architecture. It clicked right away, given my three-year DeFi journey. Smart contract development and deployment tooling is, to put it mildly, not very friendly to an average developer coming from a conventional Web2 background like me.
So after a 40-minute crash course given to me by Lukasz, I figured: why not try it myself? Mimic sounded like the kind of abstraction layer that could dramatically speed up “time-to-chain” for common on-chain workflows.
Thanks to @panditdhamdhere for introducing me to @stoczek_eth. Had a chance to learn about @mimicfi's approach to automating #DeFi and reducing "time-to-chain"
— Rashid McMoodoo (@mcmoodoo) November 27, 2025
Got connected with @facuspagnuolo who walked me through the technical details first-hand.
I wrote up the full… pic.twitter.com/4aC6SxVrNY
I started by building a simple task—the core unit you define in Mimic—and decided to automate a USD-threshold-based token transfer to see how the whole flow works end-to-end. The tooling is pleasantly straightforward, powered by the @mimicprotocol/cli package and built with oclif for a clean developer experience.
So I just installed it globally for convenience:
yarn global add @mimicprotocol/cli
❯ mimic --version
@mimicprotocol/cli/0.0.1-rc.27 linux-x64 node-v24.11.0

How We’ll Tackle This
- Initialize the project
- Edit the manifest (inputs, ABIs, metadata)
- Implement the task logic
- Build to validate, generate artifacts, and compile
- Deploy the output to the task registry for relayers
- A Few Friendly Suggestions for Mimic
Follow along in the companion walkthrough repo: mcmoodoo/token-transfer-with-mimic
Spinning Up the Workspace
I started by creating a new working directory with:
mimic init -d token-transfer

That generates a simple manifest.yaml inside the directory:
version: 1.0.0
name: Example Task
description: Autogenerated example task
inputs:
- chainId: uint32
- token: address
- amount: uint256
- recipient: address
- maxFee: uint256
The manifest file is the task’s blueprint—a declarative spec defining its name, inputs, and contract dependencies. Mimic treats it as the source of truth, using it to type-check the logic, generate bindings, and package the task. You describe the desired state; Mimic materializes it.
This mindset reminds me of why I moved from Arch to NixOS: fewer surprises, less drift, and instant rollbacks when things break. Anyway—
Defining the Rules (Manifest)
The task I’m building checks an account’s USD-denominated balance for a specific ERC-20 token and triggers a token transfer if that balance falls below a threshold. To extend the base config, I added a thresholdUsd input and switched numeric fields like amount and maxFee to strings so they support human-readable decimals. With those changes, the task can evaluate USD value and execute the transfer only when the threshold is breached.
version: 1.0.0
-name: Example Task
-description: Autogenerated example task
+name: Transfer based on USD threshold
+description: Automated task to execute parameterized transfers based on balance threshold in USD
inputs:
- chainId: uint32
- token: address
- - amount: string # e.g., '20.5' = 20.5 of the given token
+ - amount: string # e.g., '10.2' = 10.2 of the given token
- recipient: address
- - maxFee: string # e.g., '0.01' = 0.01 of the given token
+ - maxFee: string # e.g., '0.01' = 0.01 of the given token
+ - thresholdUsd: string # e.g., '30.5' = 30.5 USD
+abis:
+ - ERC20: ./abis/ERC20.json
I had to provide an ERC‑20 ABI in ./abis/ERC20.json.
Now, to validate my manifest changes, I could run:
mimic codegen
It just generates corresponding code to access the declared inputs and the contract object for the declared ABIs:
❯ tree src/types/
src/types/
├── ERC20.ts
└── index.ts
1 directory, 2 files
Those are included in the .gitignore.
Teaching the Task What to Do
The task logic lives in AssemblyScript and must export two things: the generated input type and a main function that receives those inputs. This all comes together in the ./src/task.ts file—where the actual task is defined.
So I grabbed example code from Mimic’s tutorial and implemented it in src/task.ts:
+import {
+ log,
+ TokenAmount,
+ USD,
+} from "@mimicprotocol/lib-ts";
+import { ERC20 } from "./types/ERC20";
export default function main(): void {
- const amount = BigInt.fromStringDecimal(inputs.amount, token.decimals)
- const maxFee = BigInt.fromStringDecimal(inputs.maxFee, token.decimals)
- Transfer.create(token, amount, inputs.recipient, maxFee).send()
+ const tokenContract = new ERC20(inputs.token, inputs.chainId);
+ const balance = tokenContract.balanceOf(inputs.recipient);
+
+ const balanceInUsd = TokenAmount.fromBigInt(token, balance).toUsd();
+ const thresholdUsd = USD.fromStringDecimal(inputs.thresholdUsd);
+ log.info(`Balance in USD: ${balanceInUsd}`);
+
+ if (balanceInUsd.lt(thresholdUsd)) {
+ const amount = BigInt.fromStringDecimal(inputs.amount, token.decimals);
+ const maxFee = BigInt.fromStringDecimal(inputs.maxFee, token.decimals);
+ Transfer.create(token, amount, inputs.recipient, maxFee).send();
+ }
}
Turning Code into Artifacts
Let’s compile to convert my task logic and manifest into deployable artifacts:
mimic compile

The result:
build/
├── task.wasm # Compiled WASM binary
├── manifest.json # Validated manifest
Putting It on the Map (Deploy)
Apparently I can upload my task artifacts to the network (Mimic Registry) so others can discover them, but I will need a DEPLOYMENT_KEY. So, I rushed to explorer app ↗
to get a DEPLOYMENT_KEY, which I saved as a local environment variable $MIMIC_API_KEY. After a quick login with my wallet, I was dropped into my dashboard with an API key already generated for me:

I could have skipped the build via --skip-compile flag, because I’ve already compiled and generated the artifacts in the previous step, but I just regenerated it all:
mimic deploy --key $MIMIC_API_KEY

It deployed and saved the artifacts to IPFS with the CID QmSTBXXP2CjzRkxSYew9YPKU2m2qcUbvdyveUiqvQvoLZX ↗

Dialing In the Settings
After deploying the task, I could have jumped into the explorer UI to set up my config—the place where you plug in the parameters from your manifest.yaml and sign everything with your wallet. I didn’t actually do that this time, but the flow is simple: open the explorer, find your task under Tasks, edit the fields, hit sign, done.
What’s cool is that you never have to redeploy the task just to change something. If you want to tweak the config later, you just sign a new version in the explorer and relayers immediately switch to it.
A Few Friendly Suggestions for Mimic
- Ship shell completions in the Mimic CLI (tab‑complete commands and flags).
- Make northeast‑arrow links open in a new tab to prevent context loss.

- Add more visuals in docs (diagrams and short clips where helpful).
- Publish a short video walkthrough to prime new users.
- Tighten copy in guides: front‑load the “how,” trim repetition.
Follow @mimicfi on X