Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

stablecoin-evm

> 编程语言
Open source

Source repository for smart contracts used by Circle's stablecoins on EVM-compatible blockchains

781 stars0 likes0 views
WebsiteGitHub

About

Source repository for smart contracts used by Circle's stablecoins on EVM-compatible blockchains

Circle's Stablecoin Smart Contracts on EVM-compatible blockchains

This repository contains the smart contracts used by Circle's stablecoins on EVM-compatible blockchains. All contracts are written in Solidity and managed by the Hardhat framework.

Table of contents

  • Setup
    • Development Environment
    • IDE
  • Development
    • TypeScript type definition files for the contracts
    • Linting and Formatting
    • Testing
  • Deployment
  • Contracts
  • FiatToken features
    • ERC20 compatible
    • Pausable
    • Upgradable
    • Blacklist
    • Minting/Burning
    • Ownable
  • Additional Documentations

Setup

Development Environment

Requirements:

  • Node 20.9.0
  • Yarn 1.22.19
  • Foundry@f625d0f
bash
$ nvm use
$ npm i -g [email protected] # Install yarn if you don't already have it
$ yarn install          # Install npm packages and other dependencies listed in setup.sh

IDE

We recommend using VSCode for the project here with these extensions installed.

Development

TypeScript type definition files for the contracts

Types are automatically generated as a part of contract compilation:

bash
$ yarn compile

To generate typing without re-compiling, run

bash
$ yarn hardhat typechain

Linting and Formatting

To check code for problems:

bash
$ yarn static-check   # Runs a static check on the repo.

or run the checks individually:

bash
$ yarn typecheck      # Type-check TypeScript code
$ yarn lint           # Check JavaScript and TypeScript code
$ yarn lint --fix     # Fix problems where possible
$ yarn solhint        # Check Solidity code

To auto-format code:

bash
$ yarn fmt

Testing

Run all tests:

bash
$ yarn test

To run tests in a specific file, run:

bash
$ yarn test [path/to/file]

To run tests and generate test coverage, run:

bash
$ yarn coverage

To check the size of contracts in the repo, run the following command.

bash
$ yarn contract-size # Ignores tests

Deployment

  1. Create a copy of the file .env.example, and name it .env. Fill in appropriate values in the .env file. This file must not be checked into the repository.
bash
cp .env.example .env
  1. Create a blacklist.remote.json file and populate it with a list of addresses to be blacklisted. This file must not be checked into the repository.
bash
echo "[]" > blacklist.remote.json
  1. Simulate a deployment by running the following command
bash
yarn forge:simulate scripts/deploy/deploy-fiat-token.s.sol --rpc-url 
  1. Validate that all transactions to be broadcasted are filled in with the correct values
  2. Deploy the contracts by running the following command
bash
yarn forge:broadcast scripts/deploy/deploy-fiat-token.s.sol --rpc-url 
  1. Verify the contracts on an Etherscan flavored block explorer by running the following command. Ensure that ETHERSCAN_KEY is set in the .env file.
bash
yarn forge:verify scripts/deploy/deploy-fiat-token.s.sol --rpc-url 

Contracts

The FiatToken contracts adheres to OpenZeppelin's Proxy Upgrade Pattern (permalink). There are 2 main contracts - an implementation contract (FiatTokenV2_2.sol) that contains the main logic for FiatToken's functionalities, and a proxy contract (FiatTokenProxy.sol) that redirects function calls to the implementation contract. This allows upgrading FiatToken's functionalities, as a new implementation contact can be deployed and the Proxy can be updated to point to it.

FiatToken features

The FiatToken offers a number of capabilities, which briefly are described below. There are more detailed design docs in the doc directory.

ERC20 compatible

The FiatToken implements the ERC20 interface.

Pausable

The entire contract can be frozen, in case a serious bug is found or there is a serious key compromise. No transfers can take place while the contract is paused. Access to the pause functionality is controlled by the pauser address.

Upgradable

A new implementation contract can be deployed, and the proxy contract will forward calls to the new contract. Access to the upgrade functionality is guarded by a proxyOwner address. Only the proxyOwner address can change the proxyOwner address.

Blacklist

The contract can blacklist certain addresses which will prevent those addresses from transferring or receiving tokens. Access to the blacklist functionality is controlled by the blacklister address.

Minting/Burning

Tokens can be minted or burned on demand. The contract supports having multiple minters simultaneously. There is a masterMinter address which controls the list of minters and how much each is allowed to mint. The mint allowance is similar to the ERC20 allowance - as each minter mints new tokens their allowance decreases. When it gets too low they will need the allowance increased again by the masterMinter.

Ownable

The contract has an Owner, who can change the owner, pauser, blacklister, or masterMinter addresses. The owner can not change the proxyOwner address.

Additional Documentations

  • FiatToken design
  • MasterMinter design
  • Deployment process
  • Preparing an upgrade
  • Upgrading from v2.1 to v2.2
  • Celo FiatToken extension
  • Bytecode verification

Issues· 128 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言