Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Keefer Taylor committed Sep 20, 2021
0 parents commit d10e812
Show file tree
Hide file tree
Showing 47 changed files with 28,793 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
notify_init:
runs-on: ubuntu-latest
steps:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- name: Discord notification PR
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: >
<: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)
```${{ github.event.head_commit.message }}```
build_and_test_smart_contracts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-python@v2
- name: "Install SmartPy"
run: |
curl -s https://smartpy.io/releases/20201222-65067da80037a151c726ae887cc2a24d02eca2b0/cli/install.sh | sh -s -- local-install ~/smartpy-cli
- name: "Build and Test Smart Contracts"
run: |
cd smart_contracts
./compile.sh
lint_and_build_deploy_scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: "Install Dependencies"
run: |
sudo apt-get update && sudo apt-get install build-essential git libusb-1.0-0 libusb-1.0-0-dev libudev-dev
- name: "Build and lint deploy scripts"
run: |
cd deploy
npm i
npm run lint
npm run build
notify_complete:
runs-on: ubuntu-latest
needs:
- notify_init
- build_and_test_smart_contracts
- lint_and_build_deploy_scripts
steps:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- name: Discord notification PR
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: >
<: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)
```${{ github.event.head_commit.message }}```
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Kolibri

## Directory Structure

- `deploy/`: NPM package to deploy the system.
- `documentation/`: Documentation on the system, focused on smart contracts and high level concepts.
- `smart_contracts/`: SmartPy Smart Contracts and compiled michelson code
- `sdk/`: NPM Package to interact with stable coin system.
- `vue-frontend/`: Front end for Kolibri.finance
8 changes: 8 additions & 0 deletions deploy/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Do not lint submodules.
multisig-timelock

# Do not lint generated files.
build

# Do not lint node_modules
node_modules
98 changes: 98 additions & 0 deletions deploy/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
module.exports = {
root: true,
rules: {
'prefer-template': 2
},

parser: '@typescript-eslint/parser', // Make ESLint compatible with TypeScript
parserOptions: {
// Enable linting rules with type information from our tsconfig
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json'],

sourceType: 'module', // Allow the use of imports / ES modules

ecmaFeatures: {
impliedStrict: true, // Enable global strict mode
},
},

// Specify global variables that are predefined
env: {
browser: true, // Enable browser global variables
node: true, // Enable node global variables & Node.js scoping
es2020: true, // Add all ECMAScript 2020 globals and automatically set the ecmaVersion parser option to ES2020
jest: true, // Add Jest testing global variables
},

plugins: [
'@typescript-eslint', // Add some TypeScript specific rules, and disable rules covered by the typechecker
'import', // Add rules that help validate proper imports
'jest', // Add rules for writing better Jest tests
'prettier', // Allows running prettier as an ESLint rule, and reporting differences as individual linting issues
],

extends: [
// ESLint recommended rules
'eslint:recommended',

// Add TypeScript-specific rules, and disable rules covered by typechecker
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',

// Add rules for import/export syntax
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',

// Add rules for Jest-specific syntax
'plugin:jest/recommended',

// Add rules that specifically require type information using our tsconfig
'plugin:@typescript-eslint/recommended-requiring-type-checking',

// Enable Prettier for ESLint --fix, and disable rules that conflict with Prettier
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],

// rules: {
// // This rule is about explicitly using `return undefined` when a function returns any non-undefined object.
// // 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.
// "consistent-return": "off",
// },

overrides: [
// Overrides for all test files
{
files: '__tests__/**/*.ts',
rules: {
// For our just test files, the pattern has been to have unnamed functions
'func-names': 'off',
// 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.
'@typescript-eslint/no-non-null-assertion': 'off',
// For some test files, we shadow testing constants with function parameter names
'no-shadow': 'off',
// Some of our test files declare helper classes with errors
'max-classes-per-file': 'off',
},
},
{
files: '**/*.ts',
rules: {
// Allow unused variables in our files when explicitly prepended with `_`.
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],

// Allow us to import computed values for GRPC package definitions
'import/namespace': [2, { allowComputed: true }],

// These rules are deprecated, but we have an old config that enables it
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
},
},
],
}
1 change: 1 addition & 0 deletions deploy/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/**/*
8 changes: 8 additions & 0 deletions deploy/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
tabWidth: 2,
printWidth: 80,
singleQuote: true,
semi: false,
trailingComma: "all",
arrowParens: "always",
};
19 changes: 19 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Deploy Scripts

This NPM package allows stablecoin contracts to be deployed.

## Rebuild Smart Contracts and Deploy
```
npm run deploy
```

## Re-compile Contracts
```
npm run build-smart-contracts
```

## Deploy without Rebuilding Smart Contracts
```
npm run deploy-no-build
```

Loading

0 comments on commit d10e812

Please sign in to comment.