ERC20
This contract is an ERC20 token.
Name
USD Coin
Symbol
USDC
Decimals
6
Total Supply
25,604,211,611 USDC
About link description
USD Coin (USDC) is a cryptocurrency and operates on the Ethereum platform. USD Coin has a current supply of 26,373,978,760.0296. The last known price of USD Coin is 1.00013148 USD and is down -0.02 over the last 24 hours. It is currently trading on 970 active market(s) with $1,940,822,887.60 traded over the last 24 hours. More information can be found at https://www.centre.io/usdc.
Stats
Public Functions
37
Event Types
17
Code Size
77,645 bytes
Events (17) keyboard_arrow_up
Constants (4) keyboard_arrow_up
TRANSFER_WITH_AUTHORIZATION_TYPEHASH Constant
bytes32 help
0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267
RECEIVE_WITH_AUTHORIZATION_TYPEHASH Constant
bytes32 help
0xd099cc98ef71107a616c4f0f941f04c322d8e254fe26b3c6668db87aae413de8
CANCEL_AUTHORIZATION_TYPEHASH Constant
bytes32 help
0x158b0a9edf7a828aad02f63cd515c68ef2f50ba807396f6d12842833a1597429
PERMIT_TYPEHASH Constant
bytes32 help
0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9
State Variables (21) keyboard_arrow_up
Functions
nonces keyboard_arrow_up
authorizationState keyboard_arrow_up
owner keyboard_arrow_up
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
setOwner(newOwner);
}
rescuer keyboard_arrow_up
rescueERC20 keyboard_arrow_up
Modifiers help
onlyRescuer checks for the following:
Source Code
function rescueERC20(
IERC20 tokenContract,
address to,
uint256 amount
) external onlyRescuer {
tokenContract.safeTransfer(to, amount);
}
updateRescuer keyboard_arrow_up
isBlacklisted keyboard_arrow_up
blacklist keyboard_arrow_up
Modifiers help
onlyBlacklister checks for the following:
Source Code
function blacklist(address _account) external onlyBlacklister {
blacklisted[_account] = true;
emit Blacklisted(_account);
}
unBlacklist keyboard_arrow_up
Modifiers help
onlyBlacklister checks for the following:
Source Code
function unBlacklist(address _account) external onlyBlacklister {
blacklisted[_account] = false;
emit UnBlacklisted(_account);
}
updateBlacklister keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function updateBlacklister(address _newBlacklister) external onlyOwner {
require(
_newBlacklister != address(0),
"Blacklistable: new blacklister is the zero address"
);
blacklister = _newBlacklister;
emit BlacklisterChanged(blacklister);
}
pause keyboard_arrow_up
unpause keyboard_arrow_up
updatePauser keyboard_arrow_up
initialize keyboard_arrow_up
Parameters help
Requirements help
Source Code
function initialize(
string memory tokenName,
string memory tokenSymbol,
string memory tokenCurrency,
uint8 tokenDecimals,
address newMasterMinter,
address newPauser,
address newBlacklister,
address newOwner
) public {
require(!initialized, "FiatToken: contract is already initialized");
require(
newMasterMinter != address(0),
"FiatToken: new masterMinter is the zero address"
);
require(newPauser != address(0), "FiatToken: new pauser is the zero address");
require(
newBlacklister != address(0),
"FiatToken: new blacklister is the zero address"
);
require(newOwner != address(0), "FiatToken: new owner is the zero address");
name = tokenName;
symbol = tokenSymbol;
currency = tokenCurrency;
decimals = tokenDecimals;
masterMinter = newMasterMinter;
pauser = newPauser;
blacklister = newBlacklister;
setOwner(newOwner);
initialized = true;
}
mint keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
onlyMinters checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function mint(address _to, uint256 _amount)
external
whenNotPaused
onlyMinters
notBlacklisted(msg.sender)
notBlacklisted(_to)
returns (bool)
{
require(_to != address(0), "FiatToken: mint to the zero address");
require(_amount > 0, "FiatToken: mint amount not greater than 0");
uint256 mintingAllowedAmount = minterAllowed[msg.sender];
require(
_amount <= mintingAllowedAmount,
"FiatToken: mint amount exceeds minterAllowance"
);
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
minterAllowed[msg.sender] = mintingAllowedAmount.sub(_amount);
emit Mint(msg.sender, _to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
minterAllowance keyboard_arrow_up
isMinter keyboard_arrow_up
allowance keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
approve keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function approve(address spender, uint256 value)
external
override
whenNotPaused
notBlacklisted(msg.sender)
notBlacklisted(spender)
returns (bool)
{
_approve(msg.sender, spender, value);
return true;
}
transferFrom keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function transferFrom(
address from,
address to,
uint256 value
)
external
override
whenNotPaused
notBlacklisted(msg.sender)
notBlacklisted(from)
notBlacklisted(to)
returns (bool)
{
require(
value <= allowed[from][msg.sender],
"ERC20: transfer amount exceeds allowance"
);
_transfer(from, to, value);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(value);
return true;
}
transfer keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function transfer(address to, uint256 value)
external
override
whenNotPaused
notBlacklisted(msg.sender)
notBlacklisted(to)
returns (bool)
{
_transfer(msg.sender, to, value);
return true;
}
configureMinter keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
onlyMasterMinter checks for the following:
Source Code
function configureMinter(address minter, uint256 minterAllowedAmount)
external
whenNotPaused
onlyMasterMinter
returns (bool)
{
minters[minter] = true;
minterAllowed[minter] = minterAllowedAmount;
emit MinterConfigured(minter, minterAllowedAmount);
return true;
}
removeMinter keyboard_arrow_up
Modifiers help
onlyMasterMinter checks for the following:
Source Code
function removeMinter(address minter) external onlyMasterMinter returns (bool) {
minters[minter] = false;
minterAllowed[minter] = 0;
emit MinterRemoved(minter);
return true;
}
burn keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
onlyMinters checks for the following:
notBlacklisted checks for the following:
Source Code
function burn(uint256 _amount)
external
whenNotPaused
onlyMinters
notBlacklisted(msg.sender)
{
uint256 balance = balances[msg.sender];
require(_amount > 0, "FiatToken: burn amount not greater than 0");
require(balance >= _amount, "FiatToken: burn amount exceeds balance");
totalSupply_ = totalSupply_.sub(_amount);
balances[msg.sender] = balance.sub(_amount);
emit Burn(msg.sender, _amount);
emit Transfer(msg.sender, address(0), _amount);
}
updateMasterMinter keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function updateMasterMinter(address _newMasterMinter) external onlyOwner {
require(
_newMasterMinter != address(0),
"FiatToken: new masterMinter is the zero address"
);
masterMinter = _newMasterMinter;
emit MasterMinterChanged(masterMinter);
}
initializeV2 keyboard_arrow_up
Requirements help
initialized must be true
Source Code
function initializeV2(string calldata newName) external {
// solhint-disable-next-line reason-string
require(initialized && _initializedVersion == 0);
name = newName;
DOMAIN_SEPARATOR = EIP712.makeDomainSeparator(newName, "2");
_initializedVersion = 1;
}
increaseAllowance keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function increaseAllowance(address spender, uint256 increment)
external
whenNotPaused
notBlacklisted(msg.sender)
notBlacklisted(spender)
returns (bool)
{
_increaseAllowance(msg.sender, spender, increment);
return true;
}
decreaseAllowance keyboard_arrow_up
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function decreaseAllowance(address spender, uint256 decrement)
external
whenNotPaused
notBlacklisted(msg.sender)
notBlacklisted(spender)
returns (bool)
{
_decreaseAllowance(msg.sender, spender, decrement);
return true;
}
transferWithAuthorization keyboard_arrow_up
Parameters help
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function transferWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) external whenNotPaused notBlacklisted(from) notBlacklisted(to) {
_transferWithAuthorization(
from,
to,
value,
validAfter,
validBefore,
nonce,
v,
r,
s
);
}
receiveWithAuthorization keyboard_arrow_up
Parameters help
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function receiveWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) external whenNotPaused notBlacklisted(from) notBlacklisted(to) {
_receiveWithAuthorization(
from,
to,
value,
validAfter,
validBefore,
nonce,
v,
r,
s
);
}
cancelAuthorization keyboard_arrow_up
permit keyboard_arrow_up
Parameters help
Modifiers help
whenNotPaused checks for the following:
notBlacklisted checks for the following:
notBlacklisted checks for the following:
Requirements help
Source Code
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external whenNotPaused notBlacklisted(owner) notBlacklisted(spender) {
_permit(owner, spender, value, deadline, v, r, s);
}
initializeV2_1 keyboard_arrow_up
Requirements help
Source Code
function initializeV2_1(address lostAndFound) external {
// solhint-disable-next-line reason-string
require(_initializedVersion == 1);
uint256 lockedAmount = balances[address(this)];
if (lockedAmount > 0) {
_transfer(address(this), lostAndFound, lockedAmount);
}
blacklisted[address(this)] = true;
_initializedVersion = 2;
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.
internal FiatTokenV2._increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function _increaseAllowance(
address owner,
address spender,
uint256 increment
) internal override {
_approve(owner, spender, allowed[owner][spender].add(increment));
}
internal FiatTokenV2._decreaseAllowance keyboard_arrow_up
Requirements help
Source Code
function _decreaseAllowance(
address owner,
address spender,
uint256 decrement
) internal override {
_approve(
owner,
spender,
allowed[owner][spender].sub(
decrement,
"ERC20: decreased allowance below zero"
)
);
}
internal FiatTokenV1._approve keyboard_arrow_up
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 value
) internal override {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
allowed[owner][spender] = value;
emit Approval(owner, spender, value);
}
internal FiatTokenV1._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address from,
address to,
uint256 value
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(value <= balances[from], "ERC20: transfer amount exceeds balance");
balances[from] = balances[from].sub(value);
balances[to] = balances[to].add(value);
emit Transfer(from, to, value);
}
internal AbstractFiatTokenV1._approve keyboard_arrow_up
internal AbstractFiatTokenV1._transfer keyboard_arrow_up
internal Ownable.setOwner keyboard_arrow_up
internal Ownable.setOwner keyboard_arrow_up
internal Ownable.setOwner keyboard_arrow_up
internal Ownable.setOwner keyboard_arrow_up
internal EIP3009._transferWithAuthorization keyboard_arrow_up
Parameters help
Requirements help
Source Code
function _transferWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) internal {
_requireValidAuthorization(from, nonce, validAfter, validBefore);
bytes memory data = abi.encode(
TRANSFER_WITH_AUTHORIZATION_TYPEHASH,
from,
to,
value,
validAfter,
validBefore,
nonce
);
require(
EIP712.recover(DOMAIN_SEPARATOR, v, r, s, data) == from,
"FiatTokenV2: invalid signature"
);
_markAuthorizationAsUsed(from, nonce);
_transfer(from, to, value);
}
internal EIP3009._receiveWithAuthorization keyboard_arrow_up
Parameters help
Requirements help
Source Code
function _receiveWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) internal {
require(to == msg.sender, "FiatTokenV2: caller must be the payee");
_requireValidAuthorization(from, nonce, validAfter, validBefore);
bytes memory data = abi.encode(
RECEIVE_WITH_AUTHORIZATION_TYPEHASH,
from,
to,
value,
validAfter,
validBefore,
nonce
);
require(
EIP712.recover(DOMAIN_SEPARATOR, v, r, s, data) == from,
"FiatTokenV2: invalid signature"
);
_markAuthorizationAsUsed(from, nonce);
_transfer(from, to, value);
}
internal EIP3009._cancelAuthorization keyboard_arrow_up
Parameters help
Requirements help
Source Code
function _cancelAuthorization(
address authorizer,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) internal {
_requireUnusedAuthorization(authorizer, nonce);
bytes memory data = abi.encode(
CANCEL_AUTHORIZATION_TYPEHASH,
authorizer,
nonce
);
require(
EIP712.recover(DOMAIN_SEPARATOR, v, r, s, data) == authorizer,
"FiatTokenV2: invalid signature"
);
_authorizationStates[authorizer][nonce] = true;
emit AuthorizationCanceled(authorizer, nonce);
}
internal EIP3009._requireUnusedAuthorization keyboard_arrow_up
Requirements help
Source Code
function _requireUnusedAuthorization(address authorizer, bytes32 nonce)
private
view
{
require(
!_authorizationStates[authorizer][nonce],
"FiatTokenV2: authorization is used or canceled"
);
}
internal EIP3009._requireValidAuthorization keyboard_arrow_up
Parameters help
Requirements help
Source Code
function _requireValidAuthorization(
address authorizer,
bytes32 nonce,
uint256 validAfter,
uint256 validBefore
) private view {
require(now > validAfter, "FiatTokenV2: authorization is not yet valid");
require(now < validBefore, "FiatTokenV2: authorization is expired");
_requireUnusedAuthorization(authorizer, nonce);
}
internal EIP3009._markAuthorizationAsUsed keyboard_arrow_up
Source Code
function _markAuthorizationAsUsed(address authorizer, bytes32 nonce) private {
_authorizationStates[authorizer][nonce] = true;
emit AuthorizationUsed(authorizer, nonce);
}
internal AbstractFiatTokenV2._increaseAllowance keyboard_arrow_up
internal AbstractFiatTokenV2._decreaseAllowance keyboard_arrow_up
internal AbstractFiatTokenV1._approve keyboard_arrow_up
internal AbstractFiatTokenV1._transfer keyboard_arrow_up
internal EIP2612._permit keyboard_arrow_up
Parameters help
Requirements help
Source Code
function _permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
require(deadline >= now, "FiatTokenV2: permit is expired");
bytes memory data = abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
_permitNonces[owner]++,
deadline
);
require(
EIP712.recover(DOMAIN_SEPARATOR, v, r, s, data) == owner,
"EIP2612: invalid signature"
);
_approve(owner, spender, value);
}