Aptos to Supra Cheatsheet
This quick-reference guide helps you take what you know from the Aptos framework and translate it into building Move modules with the Supra framework.
Framework Overview
Both frameworks share a few similar foundational designs of code. As such, many modules and patterns are familiar, but the migration requires updating import paths, constants, and sometimes function names to reflect the Supra ecosystem.
What’s Different?
Module Prefixes: All module references in Aptos starting with
aptos_framework::
are replaced withsupra_framework::
in Supra.Additional Features: Supra includes extra modules (e.g., for randomness, advanced governance) that expand functionality.
Configuration and Constants: Some constants, such as domain separators or error codes, have been updated to reflect the Supra ecosystem.
Import Paths and Their Changes
There are differences in import paths that set Supra apart:
Aptos Example:
Supra Example:
All your module imports should replace aptos_framework
with supra_framework
accordingly.
Module and Naming Conventions
Table mapping a few key modules and their counterparts between Aptos & Supra Move Framework
Account Management
aptos_framework::account
supra_framework::account
Coin Operations
aptos_coin:: AptosCoin
supra_coin::SupraCoin
Multisig & Voting
aptos_framework::multisig_account
supra_framework::multisig_account
Fungible Assets
aptos_framework::fungible_asset
supra_framework::fungible_asset
Event Handling
aptos_framework::event
supra_framework::event
Governance
aptos_framework::governance
supra_framework::supra_governance
Staking/Consensus
aptos_framework::staking_config
supra_framework::staking_config
Randomness Configuration
Customized or external implementation
[dependencies.SupraVrf] git = "https://github.com/Entropy-Foundation/vrf-interface" Supra offers its own Supra dVRF services for developers to integrate
Detailed Code Template Comparisons
Here is an example of diff in code for both frameworks, let’s take a look at Multisig_account module from both Frameworks:
Aptos Version
Supra Version
Aside from updating the import paths and the domain separator, the business logic and error codes often remain the same. However, for advanced operations, check the Supra-specific documentation for changes in transaction handling or resource setup.
Additional Modules
Supra extends many functionalities to support a broader set of on-chain applications. Here’s a closer look at some specialized modules:
Governance & Voting
Aptos Governance: Typically found under
aptos_framework::governance
Supra Governance: Mapped to
supra_framework::supra_governance
Randomness
Aptos: May rely on external or manually configured randomness.
Last updated