RAACNFT¶
Overview¶
The RAACNFT is an ERC721 token representing real estate assets in the RAAC lending protocol. It implements minting functionality tied to house prices from the RAAC House Prices oracle and includes comprehensive fee management, ZKME compliance integration, and governance features.
Purpose¶
- Represent real estate assets as NFTs in the RAAC lending protocol
- Implement minting functionality based on house prices from RAAC House Prices oracle
- Provide fee collection for minting and secondary market sales
- Integrate with ZKME for compliance verification
- Support governance and access control features
- Enable burning functionality for security purposes
Key Features¶
Token Details¶
- Token Type: ERC721 with ERC721Enumerable and ERC2981 (royalty) support
- Payment Token: crvUSD (18 decimals)
- Price Source: RAAC House Prices oracle (18 decimals)
- Base URI: Configurable IPFS URI for metadata
Fee Structure¶
- Mint Fee: Configurable percentage (basis points) on minting
- Trade Fee: Configurable percentage (basis points) on secondary sales
- Max Fee: Configurable maximum fee limit
- Fee Collectors: Separate collectors for mint fees and royalty fees
Compliance & Security¶
- ZKME Integration: Optional compliance verification through ZKME
- Compliance Registry: Integration with RAAC compliance system
- Access Control: Role-based permissions (ADMIN_ROLE, WITHDRAW_ROLE, MINTER_ROLE)
- Burning Control: Configurable burning functionality
Key Functions¶
Minting Functions¶
Protocol Bootstrapping: Initial Minting by Protocol
In the initial phase, to bootstrap liquidity in the RWA Vault, the protocol itself will tokenize and mint the real estate asset as RAACNFTs.
These NFTs will then be deployed into the RWA Vault in exchange for iRAAC tokens.
This means that, at launch, most or all RAACNFTs may be protocol-owned and not available for public minting or trading until the protocol opens up further asset onboarding and user participation.
This approach ensures the RWA Vault is seeded with high-quality, protocol-verified assets and sufficient liquidity from the outset.
Implications:
- Early users may not be able to mint or purchase RAACNFTs directly until the protocol transitions to open minting.
- iRAAC tokens received by the protocol represent the vault's claim on the underlying tokenized real estate.
- The protocol will announce when public minting and trading of RAACNFTs is enabled.
Please monitor official RAAC channels for updates on the transition to open minting and asset onboarding.
Price Oracle Staleness & Public Minting
Although the revaluation of the underlying real estate properties is expected to occur on a weekly or bi-weekly basis, the protocol enforces a staleness parameter that defines the maximum duration a price can remain valid before being considered outdated.
- Real estate price fluctuations are expected to be minimal over short periods, so the staleness window is set accordingly.
- If the price oracle data becomes stale (i.e., not updated within the allowed window), public minting of RAACNFTs is automatically disabled to protect users from minting at potentially outdated or inaccurate prices.
- Only after the oracle is refreshed and the price is up-to-date will public minting be re-enabled.
Implications: - Users may be temporarily unable to mint new RAACNFTs if the oracle data is stale. - This mechanism ensures that all new mints are based on the most recent and reliable property valuations.
Function Name | Description | Access | Parameters |
---|---|---|---|
mint |
Mints a new RAAC NFT with fee calculation | Public | _tokenId : ID of the token to mint_amount : Amount of crvUSD to pay |
minterMint |
Mints NFT without strict KYC (for authorized minters) | MINTER_ROLE | to : Recipient addresstokenId : ID of the token to mint |
Price & Fee Functions¶
Function Name | Description | Access | Parameters |
---|---|---|---|
getHousePrice |
Gets the latest house price for a token ID | Public View | _tokenId : ID of the token |
getMintPrice |
Gets the total mint price including fees | Public View | _tokenId : ID of the token |
getFeeStructure |
Returns current fee structure | Public View | None |
Configuration Functions¶
Function Name | Description | Access | Parameters |
---|---|---|---|
setMintFee |
Sets the mint fee percentage | ADMIN_ROLE | newFee : New fee in basis points |
setTradeFee |
Sets the trade fee percentage | ADMIN_ROLE | newFee : New fee in basis points |
setMaxFee |
Sets the maximum fee percentage | ADMIN_ROLE | newFee : New max fee in basis points |
setBaseUri |
Sets the base URI for token metadata | ADMIN_ROLE | _uri : New base URI |
setFeeCollector |
Sets the mint fee collector address | ADMIN_ROLE | _feeCollector : Fee collector address |
setNFTRoyaltyFeeCollector |
Sets the royalty fee collector address | ADMIN_ROLE | _address : Royalty collector address |
ZKME Integration¶
Function Name | Description | Access | Parameters |
---|---|---|---|
setZKMEVerify |
Sets the ZKME verify contract address | ADMIN_ROLE | _zkmeVerify : ZKME verify contract address |
setZKMECooperator |
Sets the ZKME cooperator address | ADMIN_ROLE | _zkmeCooperator : ZKME cooperator address |
Access Control¶
Function Name | Description | Access | Parameters |
---|---|---|---|
addMinter |
Adds a minter to the contract | ADMIN_ROLE | minter : Address to add as minter |
removeMinter |
Removes a minter from the contract | ADMIN_ROLE | minter : Address to remove as minter |
transferRole |
Transfers a role from one address to another | ADMIN_ROLE | role : Role to transferoldAddress : Current role holdernewAddress : New role holder |
Utility Functions¶
Function Name | Description | Access | Parameters |
---|---|---|---|
withdrawUnderlying |
Withdraws underlying tokens (used by fee collector to withdraw funds deposited for NFT purchases) | WITHDRAW_ROLE | tokenAddress : Token to withdrawto : Recipient addressamount : Amount to withdraw |
burn |
Burns an NFT token | Owner/ADMIN_ROLE | tokenId : ID of the token to burn |
Critical Note
- Burning is restricted and can only be done by the owner or admin.
- Once burned, the NFT is permanently destroyed and cannot be recovered.
Implementation Details¶
- Inheritance: ERC721, ERC721Enumerable, AccessControl, ReentrancyGuard, Ownable, WithCompliance
- Price Oracle: Uses IRAACHousePrices for real-time house price data
- Fee Management: Comprehensive fee structure with separate collectors
- ZKME Integration: Optional compliance verification
- Role-Based Access: ADMIN_ROLE, WITHDRAW_ROLE, MINTER_ROLE
- Royalty Support: ERC2981 implementation
- Burning Control: Configurable burning with restrictions
- Batch Operations: Efficient token enumeration with range support
ZKME Compliance
- Requires user approval of ZKME cooperator before minting
- Optional verification via ZKME verify contract
- Can be disabled by setting addresses to zero
Expand to View Security
- Reentrancy Protection: Uses ReentrancyGuard
- Access Control: Roles enforce sensitive operations
- Fee Limits: Max fees enforced to prevent abuse
- Burning Restrictions: Optional burning controlled by admin/owner
- Compliance: Optional ZKME layer for regulatory adherence
- Safe Transfers: Uses SafeERC20