Skip to content

Commit 31d310a

Browse files
committed
initial commit
0 parents  commit 31d310a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+41408
-0
lines changed

.eslintrc.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:react/recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
],
11+
parser: '@typescript-eslint/parser',
12+
parserOptions: {
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
ecmaVersion: 12,
17+
sourceType: 'module',
18+
},
19+
plugins: ['react', '@typescript-eslint'],
20+
rules: {
21+
'react/prop-types': 0,
22+
},
23+
}

.github/workflows/PR-build.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Gatsby PR build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: '14.x'
16+
- name: Get latest npm version
17+
run: npm install -g npm@latest
18+
- name: Install dependencies
19+
run: npm ci --ignore-scripts --no-optional
20+
- name: Validate HIP & HCCP frontmatters
21+
run: npm test

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
.cache/
3+
public
4+
types/gql.ts

.prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
semi: false,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
tabWidth: 2,
6+
}

ISSUE_TEMPLATE.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
ATTENTION! If you would like to submit an HIP and it has already been written as a draft (see the [template](https://github.com/hapticDAO/HIPs/blob/master/hip-X.md) for an example), please submit it as a [Pull Request](https://github.com/hapticDAO/HIPs/pulls).
3+
4+
If you are considering a proposal but would like to get some feedback on the idea before submitting a draft, then continue opening an Issue as a thread for discussion. Note that the more clearly and completely you state your idea the higher the quality of the feedback you are likely to receive.
5+
6+
Keep in mind the following guidelines from [HIP-1](https://hips.haptic.finance/HIPS/hip-1):
7+
8+
> Each HIP must have a champion - someone who writes the HIP using the style and format described below, shepherds the discussions in the appropriate forums, and attempts to build community consensus around the idea. The HIP champion (a.k.a. Author) should first attempt to ascertain whether the idea is HIP-able. Posting to the the Protocol Discussion forum or opening an Issue is the best way to go about this.
9+
10+
> Vetting an idea publicly before going as far as writing a HIP is meant to save the potential author time. Asking the Ethereum community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions (searching the Internet does not always do the trick). It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where Ethereum is used.
11+
12+
> Once the champion has asked the Ethereum community as to whether an idea has any chance of acceptance, a draft HIP should be presented as a Pull Request. This gives the author a chance to flesh out the draft HIP to make properly formatted, of high quality, and to address initial concerns about the proposal.

PULL_REQUEST_TEMPLATE.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
When opening a pull request to submit a new HIP, please use the suggested template: https://github.com/hapticDAO/HIPs/blob/master/hip-X.md
2+
3+
We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:
4+
5+
- The PR edits only existing Draft PRs.
6+
- The build passes.
7+
- Your Github username or email address is listed in the 'author' header of all affected PRs, inside <triangular brackets>.
8+
- If matching on email address, the email address is the one publicly listed on your GitHub profile.

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# HIP [Discord](https://discord.gg/ahJVRvjyzk) [Twitter](https://twitter.com/Haptic_Finance) [Telegram](https://t.me/HapticFinance)
2+
3+
Haptic Improvement Proposals (HIP) describe standards for the Haptic platform, including core protocol specifications, client APIs, and contract standards.
4+
5+
# Contributing
6+
7+
1. Review [HIP-1](https://github.com/hapticfinance/HIPss/blob/master/content/hips/hip-1.md).
8+
2. Fork the repository by clicking "Fork" in the top right.
9+
3. Add your HIP to your fork of the repository. There is a [template HIP here](hip-x.md).
10+
4. Submit a Pull Request to Haptic's [HIPs repository](https://github.com/hapticfinance/HIPs).
11+
12+
Your first PR should be a first draft of the final HIP. It must meet the formatting criteria enforced by the build (largely, correct metadata in the header). An editor will manually review the first PR for a new HIP and assign it a number before merging it. Make sure you include a `discussions-to` header with the URL to a new thread on [research.haptic.finance](https://research.haptic.finance) where people can discuss the HIP as a whole.
13+
14+
If your HIP requires images, the image files should be included in a subdirectory of the `assets` folder for that HIP as follow: `assets/hip-X` (for hip **X**). When linking to an image in the HIP, use relative links such as `../assets/hip-X/image.png`.
15+
16+
When you believe your HIP is mature and ready to progress past the Draft phase, you should reach out to a Haptic Council member on discord by searching members with the "Haptic Council" role or finding them within the #governance channel. The Haptic Council will schedule in a call with the HIP author to go through the HIP in more detail.
17+
18+
Once assessed, a HIP is moved into `Feasibility` and a Core Contributor is assigned. The Core Contributor will work with the author to conduct a feasibility study. Once the Author and the Core Contributor are satisfied, a HIP is moved to `HC Review Pending`. Once the Haptic Council has formally reviewed the HIP during the HIP presentation they can either move it to a vote or send it back to `Feasability`. A vote is conducted within the `hapticfinance.eth` snapshot space connected to our [dApp](https://haptic.finance/) . If a vote by the Haptic Council reaches a super majority, the HIP is moved to `Approved`, otherwise it is `Rejected`.
19+
20+
Once the HIP has been implemented by either the protocol DAO or the HIP author and relevant parties, the HIP is assigned the `Implemented` status. There is a 100 pLYS (subject to changes) bounty for proposing a HIP that reaches the `Implemented` phase.
21+
22+
# HIP Statuses
23+
24+
- **Draft** - The initial state of a new HIP before the Haptic Council and core contributors have assessed it.
25+
- **Feasibility** - a HIP that is being assessed for feasibility with an assigned Core Contributor
26+
- **EC_Review_Pending** - a HIP that is awaiting a Haptic Council Review after the Author and Core Contributor are satisfied with feasibility
27+
- **Vote_Pending** - a HIP that is awaiting a vote.
28+
- **Approved** - a HIP that has successfully reached a super majority Haptic Council vote in favour.
29+
- **Rejected** - a HIP that has failed to reach a super-majority Haptic Council vote in favour.
30+
- **Implemented** - a HIP that has been released to main-net.
31+
32+
# Validation
33+
34+
HIPs must pass some validation tests.
35+
36+
It is possible to run the HIP validator locally:
37+
38+
```
39+
npm install (if not done already)
40+
npm run test
41+
```
42+
43+
# Automerger
44+
45+
The HIP repository contains an "auto merge" feature to ease the workload for HIP editors. If a change is made via a PR to a draft HIP, then the authors of the HIP can Github approve the change to have it auto-merged by the [hip-automerger](https://github.com/bakaoh/hip_automerger) bot.

bulkEdit.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { batch } = require('frontmatter-file-batcher')
2+
3+
;(() => {
4+
batch('content/**/*.md', Infinity, async ({ goods, actions }) => {
5+
console.log(goods)
6+
const { update, save } = actions
7+
8+
const newData = update({
9+
data: { type: { $set: 'Governance' } },
10+
})
11+
12+
await save(newData)
13+
console.log('Just saved:', goods.path)
14+
})
15+
})()

ci/checkFrontmatters.js

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
const Yup = require('yup')
2+
const glob = require('glob')
3+
const fm = require('front-matter')
4+
const statuses = require('./statuses')
5+
const fs = require('fs/promises')
6+
const { promisify } = require('util')
7+
const g = promisify(glob)
8+
9+
const snapshotIdRegex = /^https?:\/\/(snapshot.org).*\/([A-z0-9]{7,})$/
10+
11+
const commonValidationSchema = Yup.object().shape({
12+
file: Yup.string().required(),
13+
title: Yup.string().required(),
14+
type: Yup.string().oneOf(['Meta-Governance', 'Governance']).required(),
15+
proposal: Yup.string().matches(snapshotIdRegex),
16+
status: Yup.string().oneOf(statuses),
17+
author: Yup.string().required(),
18+
network: Yup.string()
19+
.oneOf(['Ethereum', 'Optimism', 'Ethereum & Optimism'])
20+
.required(),
21+
implementor: Yup.string().nullable(),
22+
release: Yup.string().nullable(),
23+
created: Yup.date().nullable(),
24+
updated: Yup.date().nullable(),
25+
requires: Yup.mixed().nullable(),
26+
'discussions-to': Yup.string().nullable(),
27+
})
28+
29+
const hipValidationSchema = commonValidationSchema
30+
.concat(
31+
Yup.object().shape({
32+
hip: Yup.number().required(),
33+
network: Yup.string().required(),
34+
}),
35+
)
36+
.noUnknown()
37+
.strict()
38+
39+
const hccpValidationSchema = commonValidationSchema
40+
.concat(
41+
Yup.object().shape({
42+
hccp: Yup.number().required(),
43+
}),
44+
)
45+
.noUnknown()
46+
.strict()
47+
48+
;(async () => {
49+
try {
50+
const hips = await g('./content/hips/*.md')
51+
const hccp = await g('./content/hccp/*.md')
52+
53+
// HIP
54+
await Promise.all(
55+
hips.map(async (file) => {
56+
const content = await fs.readFile(file, 'utf-8')
57+
const { attributes } = fm(content)
58+
const castValues = hipValidationSchema.cast({ file, ...attributes })
59+
return await hipValidationSchema.validate(castValues)
60+
}),
61+
)
62+
// HCCP
63+
await Promise.all(
64+
hccp.map(async (file) => {
65+
const content = await fs.readFile(file, 'utf-8')
66+
const { attributes } = fm(content)
67+
const castValues = hccpValidationSchema.cast({ file, ...attributes })
68+
return await hccpValidationSchema.validate(castValues)
69+
}),
70+
)
71+
} catch (error) {
72+
console.log(error)
73+
console.error({
74+
value: error.value,
75+
errors: error.errors,
76+
})
77+
process.exit(1)
78+
}
79+
})()

ci/statuses.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
'Draft',
3+
'Feasibility',
4+
'SC_Review_Pending',
5+
'Vote_Pending',
6+
'Approved',
7+
'Implemented',
8+
'Rejected',
9+
]

content/hccp/empty.md

Whitespace-only changes.

0 commit comments

Comments
 (0)