Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pooltogether/owner-manager-contracts
Abstract smart contract for the common manager-or-owner permissioned function modifier
https://github.com/pooltogether/owner-manager-contracts
Last synced: about 2 months ago
JSON representation
Abstract smart contract for the common manager-or-owner permissioned function modifier
- Host: GitHub
- URL: https://github.com/pooltogether/owner-manager-contracts
- Owner: pooltogether
- Created: 2021-08-31T18:53:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-11T15:21:42.000Z (about 3 years ago)
- Last Synced: 2024-04-23T21:42:36.707Z (9 months ago)
- Language: TypeScript
- Homepage:
- Size: 401 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PoolTogether Owner Manager Contracts
![Tests](https://github.com/pooltogether/owner-manager-contracts/actions/workflows/main.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/pooltogether/owner-manager-contracts/badge.svg?branch=master)](https://coveralls.io/github/pooltogether/owner-manager-contracts?branch=master)Abstract ownable and manageable contracts that can be inherited by other contracts to provide a basic access control mechanism, where
there is an owner and a manager that can be granted exclusive access to specific functions.The `owner` is first set by passing the address of the `initialOwner` to the Ownable constructor.
The owner account can be transferred through a two steps process:
1. The current `owner` calls `transferOwnership` to set a `pendingOwner`
2. The `pendingOwner` calls `acceptOwnership` to accept the ownership transferThe manager account needs to be set using `setManager`.
This module is used through inheritance. It will make available the modifiers `onlyManager`, `onlyOwner` and `onlyManagerOrOwner`, which can be applied to your functions to restrict their use to the manager and/or the owner.
## Usage
This repo is setup to compile (`nvm use && yarn compile`) and successfully pass tests (`yarn test`)# Installation
Install the repo and dependencies by running:
`yarn`## Deployment
These contracts can be deployed to a network by running:
`yarn deploy `## Verification
These contracts can be verified on Etherscan, or an Etherscan clone, for example (Polygonscan) by running:
`yarn etherscan-verify ` or `yarn etherscan-verify-polygon matic`# Testing
Run the unit tests locally with:
`yarn test`## Coverage
Generate the test coverage report with:
`yarn coverage`