Permissions Contract: SACD
Handle permissions between your app and the users
DIMO Check-in
We recommend using the SACD contract via Login with DIMO, which provides you with the most convenient path to building your application and having vehicle owners share permissions with your app.
Service Access Contract Definition (SACD), is a permission management solution for any ERC-721 token (NFT) on the DIMO Network. Designed to manage permissions for the Vehicle NFT, the contract is versatile to support other NFT assets. Permissions set will be attached to the asset, and will override any existing permissions for the same grantee.
Key Features
Set Permissions
The setPermissions
function creates a new set of permissions for a specific asset.
Check Permissions
The hasPermissions
function checks if a grantee has permissions for a specific asset.
SACD Terminologies
asset
address
The 0x
address of the asset. In the DIMO-connected vehicle case, the vehicle would be the asset
.
tokenId
uint256
The tokenId
of the targeted asset. In the DIMO-connected vehicle case, this would be the vehicle tokenId
.
grantee
address
The 0x
address of the grantee, a grantee
is the party receiving the granted permissions to the asset.
permissions
uint256
The bit array that represents the permissions
.
expiration
uint256
Unix timestamp of the expiration
to the assigned permissions.
source
string
The URI source
associated with the permissions.
Permissions Table
Permissions are hex-encoded and when decoded to binary, you will have to read from right to left. Here's a table of common permissions:
0x3ffc
0011111111111100
1,2,3,4,5,6
0xffc
0000111111111100
1,2,3,4,5
0x3fcc
0011111111001100
1,3,4,5,6
SACD Examples
Usage
To utilize SACD and get permissions to DIMO-connected vehicles from end users, you can take one of the following approaches:
(Preferred) Use Login with DIMO
Uses Transactions SDK under the hood, offers developers a plug-and-play experience
Provides a user-interface to handle permission sharing for end-users
Configurations are being managed by login.dimo.org
(Optional) Use the Transactions SDK
Self-managed configurations giving developers a lot more flexibilities
No user-interface
Last updated