Open 123456788940 opened 1 year ago
The USDTpeggedToken
is a Solidity smart contract that represents an ERC-20 token with minting functionality, cryptographic signature verification, and an authorization system to restrict minting to specific addresses. This token is pegged to a value similar to 1 USD.
The contract is built using the OpenZeppelin library and inherits from ERC20
and Ownable
contracts. It includes cryptographic features for verifying the authenticity of minting requests using digital signatures. Additionally, it features an authorization system that ensures only specific addresses are allowed to perform minting.
The contract is deployed with the following parameters:
address _reserveAddress
: The initial address of the stablecoin reserve.mint(uint256 amount, bytes32 messageHash, bytes memory signature)
amount
must be greater than 0.reserveAddress
must be set.signature
must be valid and correspond to the contract owner's signature on the messageHash
.setReserveAddress(address _reserveAddress)
reserveAddress
to the provided address.addAuthorizedAddress(address _address)
Deploy the USDTpeggedToken
contract by providing the initial reserve address.
Once the contract is deployed, authorized addresses can be added using the addAuthorizedAddress
function.
Authorized addresses can then mint tokens using the mint
function by signing a unique messageHash
and providing the corresponding signature
.
The contract owner can update the reserve address using the setReserveAddress
function and manage the list of authorized addresses using addAuthorizedAddress
.
Please tailor this README document to match your specific project's requirements and provide users with clear instructions on how to interact with your smart contract.
// SPDX-License-Identifier: MIT pragma solidity ^0.8;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract USDTpeggedToken is ERC20, Ownable { using ECDSA for bytes32;
}