Skip to content

starkware-libs/usdc-migration

Starknet Logo

License: Apache2.0

Token Migration Contract

$\color{red}\textbf{Diclaimer:}\text{ This repo is a work in progress. It is not yet audited.}$ $\color{red}\text{Both the API and the implementation are still subject to changes.}$

Content

Overview

This contract aims to aid starknet users in migrating their USDC.e tokens into USDC without having to withdraw them on L1 themselves.

API Reference

View Functions

  • get_legacy_token() -> ContractAddress - Get the ContractAddress of the legacy token.
  • get_new_token() -> ContractAddress - Get the ContractAddress of the new token.
  • is_swap_to_legacy_allowed() -> bool - Check if exchanging new tokens for legacy tokens (reverse migration) is allowed.

Migration Functions

  • swap_to_new(amount: u256) - Exchange legacy tokens for new ones (1:1 ratio).
    • Precondition: sufficient allowance for the legacy token.
  • swap_to_legacy(amount: u256) - Exchange new tokens for legacy ones (1:1 ratio).
    • Precondition: sufficient allowance for the new token.

Dependencies

Getting help

Reach out to the maintainer at any of the following:

Build and Test

Build the contracts from the repo root:

scarb --release build

To run the tests, execute:

scarb test

Audit

Find the latest audit report in docs/audit.

Security

This repo follows good practices of security, but 100% security cannot be assured. This repo is provided "as is" without any warranty. Use at your own risk.

For more information and to report security issues, please refer to our security documentation.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •