Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mathieugarcia/a8ec5bfb1aec3234803ea5f03d88d294 to your computer and use it in GitHub Desktop.
Save mathieugarcia/a8ec5bfb1aec3234803ea5f03d88d294 to your computer and use it in GitHub Desktop.
Facebook Move Instructions Cheat Sheet: Module Built-Ins
Instruction Description
Pack<n> Pop arguments 'v*', create struct of type n with 'f'_i: 'v'_i and push it on the stack.
Unpack<n> Pop struct of type 'n' from the stack and push its field values 'v*' on the stack.
BorrowField<f> Pop reference to a struct and push a reference to field 'f' of the struct.
MoveToSender<n>† Pop resource of type 'b' and publish it under the sender’s address.
MoveFrom<n>† Pop address 'a', remove resource of type 'b' from 'a', push it.
BorrowGlobal<n>† Pop address 'a', push a reference to the resource of type 'n' under 'a'.
Exists<n> Pop address 'a', push bool encoding "a resource of type 'n' exists under 'a'".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment