Skip to content

Commit

Permalink
Initial commit, NFT Omnibridge contracts version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Jan 7, 2021
0 parents commit d78333c
Show file tree
Hide file tree
Showing 75 changed files with 11,032 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/node_modules
.git
.gitignore
.dockerignore
deploy/*.config
deploy/*.env*
!deploy/.env.example
docker-compose.yml
Dockerfile*
*.log
flats
contracts.sublime-project
contracts.sublime-workspace
build/
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
build
coverage
33 changes: 33 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": [
"plugin:node/recommended",
"airbnb-base",
"plugin:prettier/recommended"
],
"plugins": ["node"],
"env": {
"node" : true,
"mocha" : true
},
"globals" : {
"artifacts": false,
"contract": false,
"assert": false,
"web3": false
},
"rules": {
"no-plusplus": "off",
"no-await-in-loop": "off",
"no-shadow": "off",
"prefer-destructuring": "off",
"no-use-before-define": ["error", { "functions": false }],
"no-restricted-syntax": "off",
"node/no-unpublished-require": "off",
"func-names": "off",
"import/no-dynamic-require": "off",
"global-require": "off",
"no-loop-func": "off",
"no-console": "off",
"node/no-missing-require": "off"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: omnibridge-nft-contracts

on: [push]

jobs:
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task: [lint, test]
steps:
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn
if: ${{ !steps.yarn-cache.outputs.cache-hit }}
- run: yarn ${{ matrix.task }}
coverage:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn
if: ${{ !steps.yarn-cache.outputs.cache-hit }}
- run: yarn coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: release

on:
release:
types: [created]

jobs:
flats:
runs-on: ubuntu-latest
steps:
- id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn
if: ${{ !steps.yarn-cache.outputs.cache-hit }}
- run: yarn flatten
- run: zip flats $(find flats -name '*.sol')
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: flats.zip
asset_name: omnibridge-nft-contracts-flattened-${{ steps.get_release.outputs.tag_name }}.zip
asset_content_type: application/zip
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
build
flats
.idea
coverage
deploy/*.config
deploy/*.env*
!deploy/.env.example
deploy/bridgeDeploymentResults.json
coverage.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.14
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120,
"bracketSpacing": true,
"overrides": [
{
"files": "*.sol",
"options": {
"singleQuote": false
}
}
]
}
6 changes: 6 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
mocha: {
timeout: 30000
},
skipFiles: ['mocks']
}
12 changes: 12 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"avoid-low-level-calls": "off",
"no-inline-assembly": "off",
"reason-string": "off",
"func-visibility": ["warn", { "ignoreConstructors": true } ],
"compiler-version": ["error", "0.7.5"]
}
}
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:14 as contracts

WORKDIR /contracts

COPY package.json yarn.lock ./
RUN yarn

COPY truffle-config.js truffle-config.js
COPY ./contracts ./contracts
RUN yarn compile

COPY flatten.sh flatten.sh
RUN yarn flatten

FROM node:14

WORKDIR /contracts

COPY package.json yarn.lock ./
RUN yarn install --prod

COPY --from=contracts /contracts/build ./build
COPY --from=contracts /contracts/flats ./flats

COPY deploy.sh deploy.sh
COPY ./deploy ./deploy

ENV PATH="/contracts/:${PATH}"
19 changes: 19 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:14

WORKDIR /contracts

COPY package.json yarn.lock ./
RUN yarn

COPY truffle-config.js truffle-config.js
COPY ./contracts ./contracts
RUN yarn compile

COPY flatten.sh flatten.sh
RUN yarn flatten

COPY deploy.sh deploy.sh
COPY ./deploy ./deploy
COPY ./test ./test

ENV PATH="/contracts/:${PATH}"
Loading

0 comments on commit d78333c

Please sign in to comment.