Skip to content

Commit

Permalink
Added architecture diagram to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
drinkcoffee committed Feb 19, 2024
1 parent b15510c commit 27541f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions contracts/allowlist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,23 @@ OperatorAllowlistUpgradeable Deployments: Note: the addresses are for the ERC 19
| Immutable zkEVM Mainnet | [929cbb](https://github.com/immutable/contracts/blob/929cbbb9bfabdc854b2c21b1c7a8c7ab396f6676/contracts/allowlist/OperatorAllowlistUpgradeable.sol) | [0x5F5EBa8133f68ea22D712b0926e2803E78D89221](https://explorer.immutable.com/address/0x5F5EBa8133f68ea22D712b0926e2803E78D89221?tab=contract) |


# Architecture

The architecture of the Operator Allowlist system is shown below.

![Operator Allowlist Architecture](./oal-architecture.png)

## OperatorAllowlistEnforced

OperatorAllowlistEnforced is an abstract contract that token contracts can inherit in order to set the address of the OperatorAllowlist registry that it will interface with, so that the token contract may enable the restriction of approvals and transfers to allowlisted users.

ERC 721 and ERC 1155 contracts extend the OperatorAllowlistEnforced contract. The OperatorAllowlistEnforced contract includes the Solidity modifiers validateApproval and validateTransfer. Token contracts should ensure that these modifiers are called whenever an approval or transfer takes place. The modifiers call a function isAllowlisted in the OperatorAllowlistUpgradeable contract. Doing this enables the restriction of approvals and transfers to allowlisted users.

## OperatorAllowlistUpgradeable

OperatorAllowlistUpgradeable is a contract implementation of an Allowlist registry, storing addresses and bytecode which are allowed to be approved operators and execute transfers of interfacing token contracts (e.g. ERC721/ERC1155). The registry will be a deployed contract that tokens may interface with and point to.
OperatorAllowlistUpgradeable is a contract implementation of an Allowlist registry, storing addresses and bytecode which are allowed to be approved operators and execute transfers of interfacing token contracts (e.g. ERC721/ERC1155). The registry will be a deployed contract that tokens may interface with and point to. The OperatorAllowlistUpgradeable contract is a Universal Upgradeable Proxy Standard (UUPS) upgrade contract, and has access control features, and implements the IOperatorAllowlist interface. OperatorAllowlistEnforced calls OperatorAllowlistUpgradeable based on functions defined in the IOperatorAllowlist interface.

## IOperatorAllowlist

IOperatorAllowlist is an interface required for interacting with an OperatorAllowlist compliant contract.

## OperatorAllowlistEnforced

OperatorAllowlistEnforced is an abstract contract that token contracts can inherit in order to set the address of the OperatorAllowlist registry that it will interface with, so that the token contract may enable the restriction of approvals and transfers to allowlisted users.
Binary file added contracts/allowlist/oal-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 27541f2

Please sign in to comment.