Skip to content

Instantly share code, notes, and snippets.

@nicosantangelo
Last active May 6, 2022 19:42
Show Gist options
  • Save nicosantangelo/fd33cb77fd9e3737c0892eb093d5314b to your computer and use it in GitHub Desktop.
Save nicosantangelo/fd33cb77fd9e3737c0892eb093d5314b to your computer and use it in GitHub Desktop.
Decentraland Contract Permissions

Index

  1. Asset-level Permissions
  2. Address-level Permissions
  3. Asset actions
  4. Important interactions and distinctions

Asset-level Permissions

Operator

Permission given by the Owner on a single Asset. There can be only one Operator for a particular Asset. It's called Approved in the ERC721 standard.

Allows

  • Transfers
  • Update content
  • Set UpdateOperator

UpdateOperator

Permission given by the Owner or the UpdateManager on a single asset. There can be only one UpdateOperator for a particular Asset

Allows

  • Update content

Address-level Permissions

Remember that these permissions are bound to an specific contract. Meaning that even if you gran the ApprovalForAll permission to an address, you'd be doing it for an specific registry, a specific set of ERC721

ApprovalForAll

Permission given by the Owner to an address. It applies to all of the owners assets. An owner can set many ApprovalForAll permissions.

Allows

  • Transfers
  • Content update
  • Set UpdateOperator
  • Set UpdateManager

UpdateManager

Permission given by the Owner or ApprovalForAll to an address. It applies to all of the owners assets. An owner can set many UpdateManagers permissions

Allows

  • Set UpdateOperator
  • Content update

Asset actions

Action Possible roles
Set UpdateOperator Owner, ApprovalForAll, UpdateManager, Operator
Set UpdateManager Owner, ApprovalForAll
Set Operator Owner
Update metadata Owner, ApprovalForAll, UpdateManager, UpdateOperator, Operator
Transfer LAND Owner, ApprovalForAll, Operator
Transfer Estate Owner, ApprovalForAll, Operator
Create Estate Owner, ApprovalForAll, Operator
Manage Estate Owner, ApprovalForAll, Operator
Ping Owner, ApprovalForAll, UpdateManager
Sell asset Owner
Cancel sell order Owner
Update order price Owner
Place a Bid Owner
Accept a Bid Owner
Cancel a Bid Owner
Mortgages Owner

Important interactions and distinctions

General

  • We use the terms Operator to describe our use of the ERC721 standard Approved permission

Revoking

  • Any permission not explicitly shown below should be revoked manually and won't be removed from the asset otherwise

Transfer

  • Transfering an Asset cleans the Operator and the UpdateOperator

Transfer LAND to Estate

  • You can't transfer LAND to the EstateRegistry contract using transferFrom, you should use transferLandToEstate
  • You must own the Esate to be able to transfer to it

Update metadata

  • You can update a LAND metadata even inside an Estate when:
    • You're the owner or the operator of the Estate and you use the Estate's updateManyLandData method
    • You're set as the operator of the LAND while being in the Estate (the old operator can't, will be cleared after transfer) using the Estate's setLandUpdateOperator method. Then you use the Estate's updateManyLandData method

Estate permissions for LAND

  • Remember that if a LAND has an UpdateOperator you'll need to re-set it using the EstateRegistry methods after adding it to an Estate. When the LAND get's transfered to the Estate, those addresses will be cleared from the LAND.

Buy asset

  • You can't buy an asset if the owner transfered to another address. The publication will still be open.
  • You can't buy your own assets

Bid asset

  • You can't bid your own assets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment