Skip to content

Commit d10e812

Browse files
author
Keefer Taylor
committed
Initial commit
0 parents  commit d10e812

Some content is hidden

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

47 files changed

+28793
-0
lines changed

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
notify_init:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Add SHORT_SHA env property with commit short sha
14+
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
15+
- name: Discord notification PR
16+
env:
17+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
18+
uses: Ilshidur/action-discord@master
19+
with:
20+
args: >
21+
<:kolibri:790471932025372693> [[{{ SHORT_SHA }}](https://github.com/{{ GITHUB_REPOSITORY }}/commit/{{ SHORT_SHA }})] [Starting Kolibri Contracts build...](https://github.com/{{ GITHUB_REPOSITORY }}/actions/runs/{{ GITHUB_RUN_ID }}?check_suite_focus=true)
22+
```${{ github.event.head_commit.message }}```
23+
24+
build_and_test_smart_contracts:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-node@v2
29+
- uses: actions/setup-python@v2
30+
- name: "Install SmartPy"
31+
run: |
32+
curl -s https://smartpy.io/releases/20201222-65067da80037a151c726ae887cc2a24d02eca2b0/cli/install.sh | sh -s -- local-install ~/smartpy-cli
33+
- name: "Build and Test Smart Contracts"
34+
run: |
35+
cd smart_contracts
36+
./compile.sh
37+
38+
lint_and_build_deploy_scripts:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
- uses: actions/setup-node@v2
43+
- name: "Install Dependencies"
44+
run: |
45+
sudo apt-get update && sudo apt-get install build-essential git libusb-1.0-0 libusb-1.0-0-dev libudev-dev
46+
- name: "Build and lint deploy scripts"
47+
run: |
48+
cd deploy
49+
npm i
50+
npm run lint
51+
npm run build
52+
53+
notify_complete:
54+
runs-on: ubuntu-latest
55+
needs:
56+
- notify_init
57+
- build_and_test_smart_contracts
58+
- lint_and_build_deploy_scripts
59+
steps:
60+
- name: Add SHORT_SHA env property with commit short sha
61+
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
62+
- name: Discord notification PR
63+
env:
64+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
65+
uses: Ilshidur/action-discord@master
66+
with:
67+
args: >
68+
<:kolibri:790471932025372693> [[{{ SHORT_SHA }}](https://github.com/{{ GITHUB_REPOSITORY }}/commit/{{ SHORT_SHA }})] [Kolibri Contracts built successfully!](https://github.com/{{ GITHUB_REPOSITORY }}/actions/runs/{{ GITHUB_RUN_ID }}?check_suite_focus=true)
69+
```${{ github.event.head_commit.message }}```

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Kolibri
2+
3+
## Directory Structure
4+
5+
- `deploy/`: NPM package to deploy the system.
6+
- `documentation/`: Documentation on the system, focused on smart contracts and high level concepts.
7+
- `smart_contracts/`: SmartPy Smart Contracts and compiled michelson code
8+
- `sdk/`: NPM Package to interact with stable coin system.
9+
- `vue-frontend/`: Front end for Kolibri.finance

deploy/.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Do not lint submodules.
2+
multisig-timelock
3+
4+
# Do not lint generated files.
5+
build
6+
7+
# Do not lint node_modules
8+
node_modules

deploy/.eslintrc.js

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
module.exports = {
2+
root: true,
3+
rules: {
4+
'prefer-template': 2
5+
},
6+
7+
parser: '@typescript-eslint/parser', // Make ESLint compatible with TypeScript
8+
parserOptions: {
9+
// Enable linting rules with type information from our tsconfig
10+
tsconfigRootDir: __dirname,
11+
project: ['./tsconfig.eslint.json'],
12+
13+
sourceType: 'module', // Allow the use of imports / ES modules
14+
15+
ecmaFeatures: {
16+
impliedStrict: true, // Enable global strict mode
17+
},
18+
},
19+
20+
// Specify global variables that are predefined
21+
env: {
22+
browser: true, // Enable browser global variables
23+
node: true, // Enable node global variables & Node.js scoping
24+
es2020: true, // Add all ECMAScript 2020 globals and automatically set the ecmaVersion parser option to ES2020
25+
jest: true, // Add Jest testing global variables
26+
},
27+
28+
plugins: [
29+
'@typescript-eslint', // Add some TypeScript specific rules, and disable rules covered by the typechecker
30+
'import', // Add rules that help validate proper imports
31+
'jest', // Add rules for writing better Jest tests
32+
'prettier', // Allows running prettier as an ESLint rule, and reporting differences as individual linting issues
33+
],
34+
35+
extends: [
36+
// ESLint recommended rules
37+
'eslint:recommended',
38+
39+
// Add TypeScript-specific rules, and disable rules covered by typechecker
40+
'plugin:@typescript-eslint/eslint-recommended',
41+
'plugin:@typescript-eslint/recommended',
42+
43+
// Add rules for import/export syntax
44+
'plugin:import/errors',
45+
'plugin:import/warnings',
46+
'plugin:import/typescript',
47+
48+
// Add rules for Jest-specific syntax
49+
'plugin:jest/recommended',
50+
51+
// Add rules that specifically require type information using our tsconfig
52+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
53+
54+
// Enable Prettier for ESLint --fix, and disable rules that conflict with Prettier
55+
'prettier/@typescript-eslint',
56+
'plugin:prettier/recommended',
57+
],
58+
59+
// rules: {
60+
// // This rule is about explicitly using `return undefined` when a function returns any non-undefined object.
61+
// // However, since we're using TypeScript, it will yell at us if a function is not allowed to return `undefined` in its signature, so we don't need this rule.
62+
// "consistent-return": "off",
63+
// },
64+
65+
overrides: [
66+
// Overrides for all test files
67+
{
68+
files: '__tests__/**/*.ts',
69+
rules: {
70+
// For our just test files, the pattern has been to have unnamed functions
71+
'func-names': 'off',
72+
// Using non-null assertions (obj!.property) cancels the benefits of the strict null-checking mode, but these are test files, so we don't care.
73+
'@typescript-eslint/no-non-null-assertion': 'off',
74+
// For some test files, we shadow testing constants with function parameter names
75+
'no-shadow': 'off',
76+
// Some of our test files declare helper classes with errors
77+
'max-classes-per-file': 'off',
78+
},
79+
},
80+
{
81+
files: '**/*.ts',
82+
rules: {
83+
// Allow unused variables in our files when explicitly prepended with `_`.
84+
'@typescript-eslint/no-unused-vars': [
85+
'error',
86+
{ argsIgnorePattern: '^_' },
87+
],
88+
89+
// Allow us to import computed values for GRPC package definitions
90+
'import/namespace': [2, { allowComputed: true }],
91+
92+
// These rules are deprecated, but we have an old config that enables it
93+
'@typescript-eslint/camelcase': 'off',
94+
'@typescript-eslint/ban-ts-ignore': 'off',
95+
},
96+
},
97+
],
98+
}

deploy/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/**/*

deploy/.prettierrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
printWidth: 80,
4+
singleQuote: true,
5+
semi: false,
6+
trailingComma: "all",
7+
arrowParens: "always",
8+
};

deploy/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Deploy Scripts
2+
3+
This NPM package allows stablecoin contracts to be deployed.
4+
5+
## Rebuild Smart Contracts and Deploy
6+
```
7+
npm run deploy
8+
```
9+
10+
## Re-compile Contracts
11+
```
12+
npm run build-smart-contracts
13+
```
14+
15+
## Deploy without Rebuilding Smart Contracts
16+
```
17+
npm run deploy-no-build
18+
```
19+

0 commit comments

Comments
 (0)