Smart contracts for tokenizing real estate rental income on Mantle Sepolia testnet.
BrickFi enables fractional investment in real estate rental income through ERC-20 tokens that represent income rights (not ownership). Investors receive monthly revenue distributions automatically via smart contracts.
- USDC:
0xf6c6D352545Eb7316fD3034232ff7eF635325D6F - PropertyFactory:
0x1619587D0d23dc67814C4C33A9639B6BDC163C18
- Network: Mantle Sepolia (Chain ID: 5003)
- RPC: https://rpc.sepolia.mantle.xyz
- Explorer: https://sepolia.mantlescan.xyz/
- Faucet: https://faucet.sepolia.mantle.xyz/
Factory that deploys PropertyToken instances. Tracks all created properties and their owners.
Main Functions:
createProperty(name, symbol, propertyInfo)- Create new property tokengetAllProperties()- Get all property addressesgetPropertiesByOwner(owner)- Get properties by owner
ERC-20 token representing rental income rights from a specific property.
Key Features:
- Stablecoin-based (USDC) investment and distribution
- Role-based access control (ADMIN_ROLE, DISTRIBUTOR_ROLE)
- Pausable for emergency controls
- Proportional revenue distribution with claim mechanism
User Functions:
invest(amount)- Invest USDC and receive property tokens ($50 per token)claimRevenue(distributionId)- Claim share of distributed revenuegetPendingRevenue(user, distributionId)- Check pending revenue
Admin Functions:
distributeRevenue(amount, description)- Distribute rental incomesetMinInvestment(amount)- Set minimum investment requirementpause()/unpause()- Emergency controls
forge install
cp .env.example .env
# Edit .env with your PRIVATE_KEYforge build
forge test# Method 1: Faucet (easiest, 1,000 USDC)
cast send 0xf6c6D352545Eb7316fD3034232ff7eF635325D6F "faucet()" \
--rpc-url https://rpc.sepolia.mantle.xyz \
--private-key $PRIVATE_KEY --legacy
# Method 2: Mint custom amount
cast send 0xf6c6D352545Eb7316fD3034232ff7eF635325D6F \
"mint(address,uint256)" <YOUR_ADDRESS> 10000000000 \
--rpc-url https://rpc.sepolia.mantle.xyz \
--private-key $PRIVATE_KEY --legacySee DEPLOYMENT.md for detailed deployment instructions.
- Token Price: $50 per token (fixed)
- Platform Fee: 2% (deducted from investment)
- USDC Decimals: 6
- PropertyToken Decimals: 18
- Solidity Version: 0.8.23
- Get test USDC from faucet
- Approve USDC spending on PropertyToken
- Call
invest(amount)to receive property tokens - Claim revenue when distributions are made
- Create property via
factory.createProperty() - Distribute rental income via
distributeRevenue() - Investors claim their proportional share
# Run all tests
forge test
# With gas report
forge test --gas-report
# Specific test
forge test --match-test test_ClaimRevenue -vvv- DEPLOYMENT.md - Deployment guide
- Mantle Docs - Network documentation
- Foundry Book - Foundry documentation