Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ernestognw/access-manager-demo
https://github.com/ernestognw/access-manager-demo
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ernestognw/access-manager-demo
- Owner: ernestognw
- Created: 2023-10-15T08:02:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-29T23:18:05.000Z (about 1 year ago)
- Last Synced: 2024-10-07T21:20:13.236Z (3 months ago)
- Language: Solidity
- Size: 46.9 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Access Manager demo setup
This is a demo setup for the Access Manager built in [Foundry](https://book.getfoundry.sh/). It deploys the following contracts:
- AccessManager: The Access Manager contract itself.
- DAOGovernor: A DAO setup to operate with the Access Manager as its timelock.
- DAOToken: A token which minting is restricted by the Access Manager for a MINTER_ROLE.
- Owned: An Ownable contract connected to an Access Manager as its owner.
- AccessControlled: An AccessControl contract connected to an Access Manager as its DEFAULT_ADMIN_ROLE.
- RollupUpgradeable: A fake rollup contract permissioned by the AccessManager.### Getting started
Create a copy of the `.env.example` into a fresh new `.env` file. Then make sure to fill the following values:
- Addresses: These are the holders of each role. Those marked as optional can be omitted and holder of the `ADMIN_ROLE` will be used instead.
- RPC API Keys: Fill the `API_KEY_ALCHEMY` for mainnet. Otherwise use `API_KEY_INFURA`. More detail in the [`foundry.toml`](./foundry.toml) file.
- Block explorer API Keys: Fill only the API key for the network you'll deploy on.
- Fill the `MNEMONIC` variable with a mnemonic phrase. The first derived account will be used to deploy the contracts, setup the roles and finally renounce its own role. Note this address will hold all the DAOTokens minted at first.### Deploying
```shell
forge script script/Deploy.s.sol --broadcast --rpc-url
```### Learn more
Explore the [demo manager at the Access Manager Explorer](https://access-manager-explorer.vercel.app/explorer/mgr-0x4ee69a1703b717cb46cd12c71c6fe225f646ba1e)
### Acknowledgements
- [PaulRBerg/foundry-template](https://github.com/PaulRBerg/foundry-template/)