PublicLock (v14)
The PublicLock Interface
Methods
DEFAULT_ADMIN_ROLE
function DEFAULT_ADMIN_ROLE() external view returns (bytes32 role)
Returns
| Name | Type | Description | 
|---|---|---|
| role | bytes32 | undefined | 
addLockManager
function addLockManager(address account) external nonpayable
Parameters
| Name | Type | Description | 
|---|---|---|
| account | address | undefined | 
approve
function approve(address to, uint256 tokenId) external nonpayable
Parameters
| Name | Type | Description | 
|---|---|---|
| to | address | undefined | 
| tokenId | uint256 | undefined | 
balanceOf
function balanceOf(address _owner) external view returns (uint256 balance)
In the specific case of a Lock, balanceOf returns only the tokens with a valid expiration timerange
Parameters
| Name | Type | Description | 
|---|---|---|
| _owner | address | undefined | 
Returns
| Name | Type | Description | 
|---|---|---|
| balance | uint256 | The number of valid keys owned by _keyOwner | 
burn
function burn(uint256 _tokenId) external nonpayable
Deactivate an existing keythe key will be expired and ownership records will be destroyed
Parameters
| Name | Type | Description | 
|---|---|---|
| _tokenId | uint256 | the id of token to burn | 
cancelAndRefund
function cancelAndRefund(uint256 _tokenId) external nonpayable
cancel is enabled with a 10% penalty by default on all Locks.
allows the key manager to expire a given tokenId and send a refund to the keyOwner based on the amount of time remaining.
Parameters
| Name | Type | Description | 
|---|---|---|
| _tokenId | uint256 | The id of the key to cancel. | 
expirationDuration
function expirationDuration() external view returns (uint256)