USN
The USN.sol contract is the core of the USN protocol, implementing the USN stablecoin token. This contract inherits from several OpenZeppelin contracts and implements custom functionality specific to the USN protocol.
Overview
USN is an ERC20 token with additional features such as minting, burning, permit functionality, and blacklisting capabilities. It's designed to maintain a stable value pegged to the US Dollar.
Contract Inheritance
USN.sol inherits from the following OpenZeppelin contracts:
ERC20
: Provides standard ERC20 token functionalityOwnable2Step
: Implements a two-step process for transferring contract ownershipERC20Burnable
: Allows token holders to burn their tokensERC20Permit
: Enables gasless token approvals
Key Features
1. Minting
Only the designated admin can mint new USN tokens
Minting increases the total supply of USN
2. Burning
Any token holder can burn their own tokens
Burning decreases the total supply of USN
3. Permit Functionality
Allows for gasless approvals using EIP-2612 standard
Enhances user experience by reducing transaction steps
4. Blacklisting
The contract owner can blacklist addresses for regulation purposes
Blacklisted addresses cannot send or receive USN tokens
Security Measures
Access Control:
Only the owner can blacklist/unblacklist accounts and set the admin
Only the admin can mint new tokens
Transfer Restrictions:
Blacklisted addresses cannot send or receive tokens
Two-Step Ownership Transfer:
Inherits Ownable2Step to prevent accidental transfer of ownership
Last updated
Was this helpful?