NFT
Inherits: ERC721EnumerableUpgradeable, UUPSUpgradeable
Contract Summary
The NFT generated post-redemption are uniformly created in accordance with the ERC-721 standard. Each NFT possesses a unique identifier, is non-fungible and indivisible, and supports functionalities such as ownership transfer, approval authorization, and metadata storage.
State Variables
NFTManagerStorageLocation
bytes32 private constant NFTManagerStorageLocation = 0x980c83754224d51d8374ad9970317aaf24ad04850ecf2b771ca42610c8b64700;azoth
Note: oz-upgrades-unsafe-allow: state-variable-immutable
address public immutable azoth;Functions
constructor
Note: oz-upgrades-unsafe-allow: constructor
initialize
onlyAzoth
addBatch
depositRWAThis function is used to add the batch information (quantity) when depositing $RWA in the depositRWA function in Azoth.
Parameters
_wRWA
address
The token address of RWA assets.
_amount
uint256
The quantity of this batch.
mint
This function is designed to mint a redemption voucher (in the form of an NFT) within the requestRedeem function of Azoth during the redemption application process.
Parameters
_wRWA
address
The token address of RWA assets
_amount
uint256
The amount of $wRWA to be redeemed is applied for
_to
address
To whom the NFT is minted
burn
This function is used in the withdrawRedeem function of Azoth to check the conditions and destroy the NFT when redeeming.
Parameters
_from
address
Address who redeem stablecoins
_tokenId
uint256
NFT tokenId
Returns
<none>
uint256
Returns the withdrawable stablecoin amount as a uint256
repay
This function is used in the Azothrepay function to indicate the amount of $RWA repayments processed.
In the loop, there is no check for whether batchAmount is out of bounds because the quantity of repay is less than or equal to the quantity applied for redemption by the user, and it has been ensured that the quantity applied for redemption does not exceed the bounds when the application for redemption is made.
Parameters
_wRWA
address
wThe token address of wRWA assets
_amount
uint256
The processed amount
_repayPrice
uint256
Repayment price
tokenURI
_authorizeUpgrade
getNextTokenId
Get the ID of the next NFT.
getNFTRedeemInfo
Get the redemption information of NFTs.
If the tokenId does not exist, return all zeros.
Parameters
_tokenId
uint256
NFT ID
Returns
<none>
address
The address of wRWA
<none>
uint256
Redemption amount
<none>
uint256
Batch (Cycle) Index
<none>
uint256
The specific location of this batch
getRwaRedeemInfo
Get the redemption information of a certain asset.
If wRWA does not exist, return all zeros.
Parameters
_wRWA
address
The address of wRWA
Returns
<none>
uint256[]
The quantities of each batch
<none>
uint256
The index of the batch to which the user's redemption application is queued
<none>
uint256
Redemption batch position application
<none>
uint256
The index of the batches of redemptions that have been processed by the official
<none>
uint256
The position of the redemption batch
getRepayInfo
Get the historical repayment data of a certain asset.
Return 0 if wRWA does not exist.
Parameters
_wRWA
address
The address of wRWA
Returns
<none>
RepayInfo[][]
Historical repayment data of type uint256[][]
isRedeemProcessed
This function is used to check whether the redemption of a certain NFT has been processed. True -> processed; False -> not processed.
Parameters
_tokenId
uint256
NFT's tokenId
getNFTTotalValue
This function is used to check how much USDT can be redeemed for a certain NFT.
When the NFT has not been processed, it returns zero.
Parameters
_tokenId
uint256
NFT's tokenId
getOwnedNFT
_getNFTManagerStorage
_checkAzoth
_calcNFTTotalValue
_render
Events
LOG_MintRedeemNFT
Errors
NextRound
NotAzoth
NotNFTOwner
InsufficientRedeemAmount
NotYetProcessed
RepayTooMuch
Structs
NFTRedeemInfo
RepayInfo
WRWARedeemInfo
NFTManagerStorage
Note: storage-location: erc7201:AZOTH.storage.NFTManager
Last updated