diff --git a/README.md b/README.md index 12e5ca0..9269ca8 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,42 @@ In order to deploy the contracts in this repo you are going to need [foundry zks The contracts in this repo are variations of well known standards taking adventage of the privacy and access control provided by double zero. Each contracts has comments in the source code explaining how they work and why they work. +At the moment we have 4 example contracts, that are variations of erc20 and erc721: + + +### PublicSelectionErc721 + +This is a variation of ERC721 where where the inventory of each user is private (secured by double zewro layer) +and then each user can select a sub set of their inventory to make public. + +**source code:** [PublicSelectionErc721.sol](./src/PublicSelectionErc721.sol) +**permission template:** [erc721-public-selection.yaml](./permission-templates/erc721-public-selection.yaml) + +### PublicScopedBalanceErc20 + +Variation of ERC20 where each user can select a threshold. And then anyone can check if the user has more or less balance +than that threshold. + +**source code:** [PublicScopedBalanceErc20.sol](./src/PublicScopedBalanceErc20.sol) +**permission template:** [erc20-public-scoped-balance.yaml](./permission-templates/erc20-public-scoped-balance.yaml) + + +### ShareBalanceErc20 + +Variation of ERC20 where each user can select individual addresses to share their balance with. + +**source code:** [ShareBalanceErc20.sol](./src/ShareBalanceErc20.sol) +**permission template:** [erc20-share-balance-with-users.yaml](./permission-templates/erc20-share-balance-with-users.yaml) + + +### ShareScopedBalanceErc20 + +Variation of ERC20 where each user can share their balance to specific addresses, but with an upper limit. + + +**source code:** [ShareScopedBalanceErc20.sol](./src/ShareScopedBalanceErc20.sol) +**permission template:** [erc20-share-scoped-balance.yaml](./permission-templates/erc20-share-scoped-balance.yaml) + ## Deploy You can deploy all the contracts by running: @@ -24,6 +60,8 @@ Once the contracts are deployed you can use the double zero explorer to check th ## Double zero permissions -Inside the `/permission-templates` folder there are several double zero permission files templates. -These are example permission restrictions for each contract to work as they re meant to work. These -can be modified to achieve different levels of privacy over each contract. \ No newline at end of file +Each file inside the `/permission-templates` folder is a an example double zero configuration +for each contract in this repo: + +- `erc20-public-scoped-balance.yaml` -> `PublicScopedBalanceErc20`. +- `erc20-public-scoped-balance.yaml` -> `PublicScopedBalanceErc20`. \ No newline at end of file diff --git a/permission-templates/erc20-public-scoped-balance.yaml b/permission-templates/erc20-public-scoped-balance.yaml index 08de0b0..261845a 100644 --- a/permission-templates/erc20-public-scoped-balance.yaml +++ b/permission-templates/erc20-public-scoped-balance.yaml @@ -1,3 +1,4 @@ +# Example configuration for `./src/PublicScopedBalanceErc20.sol`. contracts: - address: methods: diff --git a/permission-templates/erc20-share-balance-with-users.yaml b/permission-templates/erc20-share-balance-with-users.yaml index ba1cb81..4663f77 100644 --- a/permission-templates/erc20-share-balance-with-users.yaml +++ b/permission-templates/erc20-share-balance-with-users.yaml @@ -1,3 +1,4 @@ +# Example configuration for `./src/Sha.sol`. contracts: - address: methods: diff --git a/permission-templates/erc20-share-scoped-balance.yaml b/permission-templates/erc20-share-scoped-balance.yaml index 73fe2b9..03b5460 100644 --- a/permission-templates/erc20-share-scoped-balance.yaml +++ b/permission-templates/erc20-share-scoped-balance.yaml @@ -1,3 +1,4 @@ +# Example configuration for: `./src/ShareScopedBalanceErc20.sol` contracts: - address: methods: diff --git a/permission-templates/erc721-public-selection.yaml b/permission-templates/erc721-public-selection.yaml index 18887c8..094dc87 100644 --- a/permission-templates/erc721-public-selection.yaml +++ b/permission-templates/erc721-public-selection.yaml @@ -1,3 +1,4 @@ +# Example configuration for: `./src/PublicSelectionErc721.sol`. contracts: - address: methods: