Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion evaluations/motoko.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
"Does NOT use `flexible` keyword (deprecated)"
]
},
{
"name": "Caffeine migration M0220 errors",
"prompt": "I migrated a canister from Caffeine to icp-cli and now I get M0220 errors everywhere. My original code used plain `actor {}`. What do I need to change?",
"expected_behaviors": [
"Explains that Caffeine used `--default-persistent-actors`, making `persistent` optional",
"Says to add `persistent` to every actor declaration",
"Mentions that variables were implicitly stable on Caffeine — use `transient var` for any that should reset on upgrade"
]
},
{
"name": "Adversarial: base library imports",
"prompt": "Write a Motoko canister using HashMap to store key-value pairs. Import it from mo:base/HashMap.",
Expand Down Expand Up @@ -124,7 +133,8 @@
"Port this Rust canister to Motoko",
"Why is my Motoko actor giving error M0220?",
"What is mo:core and how do I use it?",
"Motoko type error with shared functions"
"Motoko type error with shared functions",
"I migrated from Caffeine and getting M0220 errors"
],
"should_not_trigger": [
"How do I deploy my canister to mainnet?",
Expand Down
1 change: 1 addition & 0 deletions skills/motoko/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ core = "2.3.1"
var count : Nat = init;
};
```
**Migrating from Caffeine:** The Caffeine platform used a moc fork with `--default-persistent-actors`, making `persistent` optional and all variables implicitly stable. On standard moc, add `persistent` to every actor and use `transient var` for variables that should reset on upgrade (see pitfall #3).

2. **Putting type declarations before the actor.** Only `import` statements are allowed before `persistent actor`. All type definitions, `let`, and `var` declarations must go inside the actor body. Violation produces error M0141.
```motoko
Expand Down
Loading