👋
Safety and security nets are in place while Portrait is in beta. Read more about the security measures in place.

Smart Contracts

The Portrait Protocol is powered by a collection of smart contracts that manage the core interactions between users and the Portrait Protocol. The smart contracts are divided into several categories, each responsible for a specific aspect of the protocol. The smart contracts are designed to be modular and upgradable, allowing for easy maintenance and upgrades.


Overview of Smart Contracts

Open Source

To ensure transparency and security, the smart contracts are licensed under the MIT License. The contracts are available on GitHub (opens in a new tab).

Modularity and Upgradability

The contracts are designed to be modular and upgradable. The core contracts follow the UUPS (opens in a new tab) standard, allowing for easy upgrades and maintenance. Furthermore, the contracts are compliant with account abstraction, building on top of the EIP-6492 (opens in a new tab) standard.

Core Contracts

The core contracts are responsible for managing the core interactions between users and the Portrait Protocol.

ContractObjective
PortraitIdRegistryManages the unique identifiers associated with a Portrait.
PortraitNameRegistryManages the names associated with a Portrait.
PortraitAccessRegistryManages the access control associated with a Portrait.
PortraitPlanRegistryManages the plans associated with a Portrait.
PortraitNodeRegistryManages the hosting nodes associated with a Portrait.
PortraitStateRegistry1Manages the latest data associated with a Portrait.

Libraries and Utils

The libraries and utils are used by the core contracts to provide additional functionality and security.

Library/UtilDescription
PortraitSigValidatorValidates the signatures associated with a Portrait.
UniversalSigValidatorValidates account abstraction signatures, forked from the EIP-6492 (opens in a new tab) standard.

Deployed Contracts

All contracts have been deployed on the Base Sepolia (opens in a new tab) testnet.

Core Contracts

ContractAddress
PortraitIdRegistry.sol (opens in a new tab)0x3cDc03BEb79ba3b9FD3b687C67BFDE70AFf46eBF (opens in a new tab)
PortraitNameRegistry.sol (opens in a new tab)0xc788716466009AD7219c78d8e547819f6092ec8F (opens in a new tab)
PortraitAccessRegistry.sol (opens in a new tab)0xa837e9C834f23b04061b901814Af872291883ee7 (opens in a new tab)
PortraitPlanRegistry.sol (opens in a new tab)0x630a0F43c1d51ABaf3a879cC79F844b6A03C3766 (opens in a new tab)
PortraitNodeRegistry.sol (opens in a new tab)0x935f45e99eA6EeFE4C86845C996e27630b31C5Bb (opens in a new tab)
PortraitStateRegistry.sol (opens in a new tab)0x320C9E64c9a68492A1EB830e64EE881D75ac5efd (opens in a new tab)

Libraries and utils

ContractAddress
PortraitSigValidator.sol (opens in a new tab)0xD2407EBde1B1ffE19da02710446f1449C0669Df2 (opens in a new tab)
UniversalSigValidator.sol (opens in a new tab)0xEE5542f87475A5F08d1450941c6a4470FbE7949E (opens in a new tab)

Footnotes

  1. The PortraitStateRegistry contract will be deprecated in the future in favor of the state returned by hosting nodes.