Skip to main content

Source Code

View the RWAToken.sol source code
UpgradabilityThis contract uses the UUPSUpgradeable pattern and inherits from ERC20Upgradeable, OwnableUpgradeable, and PausableUpgradeable.

Methods

Initialization function for the upgradeable contract. It sets token parameters, the custody wallet, the USDT reference contract, and the compliance manager.
function initialize(
    string memory _name,
    string memory _symbol,
    address _initialOwner,
    address _custodyWallet,
    address _usdt,
    address _complianceManage
) public;
_name
string
required
Token name
_symbol
string
required
Token symbol
_initialOwner
address
required
Initial owner
_custodyWallet
address
required
Custody wallet
_usdt
address
required
USDT contract address
_complianceManage
address
required
Compliance manager address
Configures sale parameters, including token price and purchase limits.
function configureSale(
    uint256 _priceUSDT,
    uint256 _minPurchaseUSDT,
    uint256 _maxPurchaseUSDT
) external;
_priceUSDT
uint256
required
Token price in USDT
_minPurchaseUSDT
uint256
required
Minimum purchase amount in USDT
_maxPurchaseUSDT
uint256
required
Maximum purchase amount in USDT
Configures the sale start and end time constraints without changing the sale’s active status.
function configureSaleTime(uint256 _startTime, uint256 _endTime) external;
_startTime
uint256
required
Start timestamp
_endTime
uint256
required
End timestamp
Activates token sales. Sale time constraints are enforced during minting.
function startSale() external;
Pauses an ongoing token sale.
function pauseSale() external;
Sets the earliest timestamp at which tokens become transferable (0 means unlocked).
function setUnlockTime(uint256 _unlockTime) external;
_unlockTime
uint256
required
Unlock timestamp
Emergency unlock mechanism that immediately allows token transfers.
function emergencyUnlock() external;
Emergency function that pauses all token transfers.
function pause() external;
Resumes all token transfers.
function unpause() external;
Updates the custody wallet address that receives raised funds.
function setCustodyWallet(address _custodyWallet) external;
_custodyWallet
address
required
New custody wallet address
Recovers unsold tokens from the sale and mints them to the custody wallet.
function recoverUnsoldTokens() external;
Recovers any ERC20 tokens that were accidentally sent to this contract.
function recoverTokens(address token) external;
token
address
required
Token contract address to recover
Executes a forced token transfer for compliance or recovery purposes.
function forcedTransfer(
    address from,
    address to,
    uint256 amount,
    string calldata reason
) external;
from
address
required
Sender address
to
address
required
Recipient address
amount
uint256
required
Transfer amount
reason
string
required
Reason for the transfer
Updates legal and valuation information for the underlying real-world asset.
function updateAssetInfo(string memory _metadataURI, uint256 _valuation) external;
_metadataURI
string
required
Metadata URI
_valuation
uint256
required
Valuation
Purchases tokens with USDT during an active sale and verifies the user’s compliance signature.
function mint(
    uint256 amountUSDT,
    bytes memory signature,
    uint256 expireTime
) external;
amountUSDT
uint256
required
Amount of USDT paid
signature
bytes
required
Compliance signature payload
expireTime
uint256
required
Signature expiration time
Owner-only function that burns tokens from a specific address for compliance or recovery purposes.
function burn(address from, uint256 amount) external;
from
address
required
Address whose tokens will be burned
amount
uint256
required
Amount to burn
Returns the remaining number of tokens available for sale.
function remainingForSale() external view returns (uint256);
Returns
uint256
Remaining number of tokens available for sale
Calculates how many tokens can be minted for a given USDT amount.
function usdtToTokenAmount(uint256 amountUSDT) public view returns (uint256);
amountUSDT
uint256
required
USDT amount
Returns
uint256
Equivalent token amount
Calculates the USDT amount required for a given token amount.
function tokenToUSDTAmount(uint256 tokenAmount) public view returns (uint256);
tokenAmount
uint256
required
Token amount
Returns
uint256
Required USDT amount