Subdivide
Source: contracts/extensions/Subdivide.sol · Guide: subdivision · Upgradeable (UUPS proxy)
Functions that change state
Function
Who can call
Also
addValidator(address validator)onlyRole(ADMIN_ROLE)batchMintUnits(uint256 deedId, uint256[] unitIds, address[] recipients)Checked inside the function
whenNotPausedburnUnit(uint256 deedId, uint256 unitId)Checked inside the function
createSubdivision(uint256 deedId, string name, string description, string symbol, string collectionUri, uint256 totalUnits, bool burnable)Checked inside the function
whenNotPauseddeactivateSubdivision(uint256 deedId)Checked inside the function
grantRole(bytes32 role, address account)Checked inside the function
initialize(address _deedNFT, address _validatorRegistry)Once, when the proxy is initialised
mintUnit(uint256 deedId, uint256 unitId, address to)Checked inside the function
whenNotPausedpause()onlyRole(ADMIN_ROLE)removeUnitTrait(uint256 deedId, uint256 unitId, string traitName)onlyCollectionAdmin(deedId)removeValidator(address validator)onlyRole(ADMIN_ROLE)renounceRole(bytes32 role, address account)Only the account renouncing its own role
revokeRole(bytes32 role, address account)The role's admin role (
DEFAULT_ADMIN_ROLE unless set otherwise)safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data)The holder, or an approved operator
safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)The holder, or an approved operator
setApprovalForAll(address operator, bool approved)The holder
setApprovedMarketplace(address marketplace, bool approved)onlyRole(ADMIN_ROLE)setBurnable(uint256 deedId, bool burnable)onlyCollectionAdmin(deedId)setRoyaltyEnforcement(bool enforced)onlyRole(ADMIN_ROLE)setSubdivisionValidator(uint256 deedId, address validator)onlyCollectionAdmin(deedId)setToDefaultSecurityPolicy()onlyRole(ADMIN_ROLE)setTransferValidator(address validator)onlyRole(ADMIN_ROLE)setUnitMetadata(uint256 deedId, uint256 unitId, string metadata)onlyCollectionAdmin(deedId)setUnitTrait(uint256 deedId, uint256 unitId, bytes32 traitKey, bytes traitValue)onlyCollectionAdmin(deedId)setUnitTraitFlexible(uint256 deedId, uint256 unitId, bytes traitKey, bytes traitValue, uint8 valueType)onlyCollectionAdmin(deedId)setUnitTraitName(bytes32 traitKey, string traitName)onlyRole(ADMIN_ROLE)transferCollectionAdmin(uint256 deedId, address newAdmin)Checked inside the function
unpause()onlyRole(ADMIN_ROLE)updateUnitValidationStatus(uint256 deedId, uint256 unitId, bool isValid, address validatorAddress)onlyRole(VALIDATOR_ROLE)upgradeTo(address newImplementation)onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)upgradeToAndCall(address newImplementation, bytes data)onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)payable
Read functions
Anyone can call these; they change nothing.
Function
Returns
ADMIN_ROLE()bytes32
balanceOf(address account, uint256 id)uint256
balanceOfBatch(address[] accounts, uint256[] ids)uint256[]
deedNFT()address
DEFAULT_ADMIN_ROLE()bytes32
defaultValidator()address
ESTATE_ASSET_TYPE()uint8
getRoleAdmin(bytes32 role)bytes32
getSubdivisionValidator(uint256 deedId)address validator
getTransferValidationFunction()bytes4 functionSignature, bool isViewFunction
getTransferValidator()address validator
getUnitAssetType(uint256 deedId, uint256 unitId)uint8
getUnitMetadata(uint256 deedId, uint256 unitId)string
getUnitTraitKeys(uint256 deedId, uint256 unitId)bytes32[]
getUnitTraitMetadataURI()string
getUnitTraitName(bytes32 traitKey)string
getUnitTraitValue(uint256 deedId, uint256 unitId, bytes32 traitKey)bytes
getUnitTraitValues(uint256 deedId, uint256 unitId, bytes32[] traitKeys)bytes[]
getUnitValidationStatus(uint256 deedId, uint256 unitId)bool isValidated, address validator
hasRole(bytes32 role, address account)bool
isApprovedForAll(address account, address operator)bool
isApprovedMarketplace(address marketplace)bool
isRoyaltyEnforced()bool
isUnitValidated(uint256 deedId, uint256 unitId)bool
LAND_ASSET_TYPE()uint8
ownerOf(uint256 tokenId)address
paused()bool
proxiableUUID()bytes32
royaltyInfo(uint256 tokenId, uint256 salePrice)address receiver, uint256 royaltyAmount
subdivisionExists(uint256 deedId)bool
subdivisions(uint256)string name, string description, string symbol, string collectionUri, uint256 totalUnits, uint256 activeUnits, bool isActive, bool burnable, address collectionAdmin, address subdivisionValidator
supportsInterface(bytes4 interfaceId)bool
supportsSubdivision(uint8 assetType)bool
unitExists(uint256 deedId, uint256 unitId)bool
uri(uint256 tokenId)string
VALIDATOR_ROLE()bytes32
validatorRegistry()address
Events
Event
AdminChanged(address previousAdmin, address newAdmin)ApprovalForAll(address account indexed, address operator indexed, bool approved)BeaconUpgraded(address beacon indexed)BurnableStatusChanged(uint256 deedId indexed, bool burnable)CollectionAdminChanged(uint256 deedId indexed, address newAdmin indexed)CollectionAdminTransferred(uint256 deedId indexed, address previousAdmin indexed, address newAdmin indexed)Initialized(uint8 version)MarketplaceApproved(address marketplace indexed, bool approved)Paused(address account)RoleAdminChanged(bytes32 role indexed, bytes32 previousAdminRole indexed, bytes32 newAdminRole indexed)RoleGranted(bytes32 role indexed, address account indexed, address sender indexed)RoleRevoked(bytes32 role indexed, address account indexed, address sender indexed)RoyaltyEnforcementChanged(bool enforced)SubdivisionCreated(uint256 deedId indexed, string name, uint256 totalUnits)SubdivisionDeactivated(uint256 deedId indexed)SubdivisionValidatorUpdated(uint256 deedId indexed, address validator indexed)TransferBatch(address operator indexed, address from indexed, address to indexed, uint256[] ids, uint256[] values)TransferSingle(address operator indexed, address from indexed, address to indexed, uint256 id, uint256 value)UnitBurned(uint256 deedId indexed, uint256 unitId indexed)UnitMetadataUpdated(uint256 deedId indexed, uint256 unitId indexed, string metadata)UnitMinted(uint256 deedId indexed, uint256 unitId indexed, address to)UnitTraitUpdated(uint256 deedId indexed, uint256 unitId indexed, bytes32 traitKey indexed, bytes traitValue)UnitValidated(uint256 deedId indexed, uint256 unitId indexed, bool isValid)Unpaused(address account)Upgraded(address implementation indexed)URI(string value, uint256 id indexed)Errors
Error
AlreadyValidated()InvalidParameter()SubdivisionDoesNotExist()Unauthorized()