Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zenodeapp/zenode-contracts
A lightweight repository that aims to bundle commonly used Solidity contracts, libraries and helper functions together.
https://github.com/zenodeapp/zenode-contracts
access-control contracts git-submodule hardhat helper-functions libraries lightweight ownership solidity solidity-contracts
Last synced: 28 days ago
JSON representation
A lightweight repository that aims to bundle commonly used Solidity contracts, libraries and helper functions together.
- Host: GitHub
- URL: https://github.com/zenodeapp/zenode-contracts
- Owner: zenodeapp
- License: mit
- Created: 2022-10-19T04:05:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-01T05:55:01.000Z (about 2 years ago)
- Last Synced: 2023-03-10T18:36:49.381Z (almost 2 years ago)
- Topics: access-control, contracts, git-submodule, hardhat, helper-functions, libraries, lightweight, ownership, solidity, solidity-contracts
- Language: Solidity
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ZENODE Contracts
A lightweight repository that aims to bundle commonly used Solidity contracts, libraries and helper functions together.
This has been built by ZENODE and is licensed under the MIT-license (see [LICENSE.md](./LICENSE.md)).
## Overview
### Contracts
- [Ownable.sol](contracts/base/Ownable.sol)
- Create ownable contracts
- Adding and removing of administrators
- Limiting read/write access
- Ownership transference### Libraries
\-
### Helpers
- [hardhat.js](helpers/hardhat.js) helper functions.
## Getting Started
Including this repository in your projects can be done in multiple ways:
- Adding it as a Git submodule to your project (recommended)
- Adding it as an npm module
- Git cloning (or downloading as a .zip)### Add as a Git submodule
This is the approach I personally recommend for it clearly shows that this repository is a subset of your project. It could also give insight to which commit we're currently on and whether there have been changes to the sub-repository.
1. **Clone and stage the submodule**
```
git submodule add -b main https://github.com/zenodeapp/zenode-contracts.git
```> \ can be omitted, this will clone the repo in the current directory inside a folder named `zenode-contracts`.
2. **Commit and push**
```
git commit -a -m "Added submodule zenode-contracts.git"
git push
```**Updating submodules (for in the future)**
To pull and incorporate the most recent changes, run this command inside the root of your main repository:
```
git submodule update --remote --recursive
```> Omit \ to update every submodule.
**Cloning repositories with submodules (for in the future)**By default, cloning a repository with submodules won't include the files for every submodule. This may be considered a drawback as it requires extra knowledge and experience from your targeted audience.
Cloning the repo now requires an extra flag: `--recursive`.
```
git clone --recursive
```If you forgot to include the `--recursive` flag, you could always run the following git command to fetch all submodules:
```
git submodule update --init --recursive
```> Here the `--recursive` flag is optional and only necessary if you have nested submodules (submodules containing submodules).
**Useful tip!**
The `git submodule foreach '[git action]'`-command is very useful when it comes to performing git actions on multiple submodules at once.
```
git submodule foreach 'git fetch'
git submodule foreach 'git diff ...origin'
```> This example fetches all changes for every submodule and displays them in your terminal.
You can read more about Submodules in the [Git Documentation](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
### Add as an npm module
This repository hasn't been registered as an npm module, but can be added as a dependency using a package manager of your choosing.
```
npm install zenodeapp/zenode-contracts
``````
yarn add zenodeapp/zenode-contracts
```> The syntax is \/\, which might be different for other package manager tools.
If you're interested in a specific branch, commit or tag, run the following command instead:
```
npm install zenodeapp/zenode-contracts#
``````
yarn add zenodeapp/zenode-contracts#
```Do have in mind that the usual approach to updating modules with your package manager will probably not work with git packages; re-install the package instead if you wish to pull the most recent changes to your project.
### Add by downloading or cloning
- Download .zip file on Github (top-right):
![download-zip](https://user-images.githubusercontent.com/108588903/197372280-df92e403-0805-4095-86b5-433f88773b52.png)
- Or, clone the repository using the command line:
```
git clone https://github.com/zenodeapp/zenode-contracts.git
```> Cloning creates a directory with the same name as the repo in the specified folder.
>
> > If you want to clone into the folder you're currently in, use '.' instead:
> >
> > ```
> > git clone https://github.com/zenodeapp/zenode-contracts.git .
> > ```
— ZEN
Copyright (c) 2022 ZENODE