Skip to content

Commit c00ae71

Browse files
authored
Merge pull request #1101 from eduarddfinity/patch-1
Add security disclaimer in the icrc-2 swap example
2 parents 899e03d + f41de19 commit c00ae71

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

motoko/icrc2-swap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ make test
313313
which would cost tokens. For a real canister, you should calculate the maximum
314314
size of your canister, limit it to a reasonable amount, and monitor the
315315
current size to know when to re-architect.
316+
- **Async Bug Trap**. The ICRC-2 swap implementation in this repository contains potential bug traps related to async calls. For example, the `deposit` function calls `icrc2_transfer_from`, but there is no guarantee that the callback code will execute correctly once the call succeeds. This can happen if the canister runs out of cycles or due to other side effects in the Internet Computer environment. To properly address these types of issues, for example by implemeting journaling, please refer to the [inter-canister calls security best practices](https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/inter-canister-calls).
316317

317318
## Contributing
318319

0 commit comments

Comments
 (0)