Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions contracts/erc3643/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint-config-airbnb-base",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"node": true,
"mocha": true
},
"globals": {
"expect": true,
"artifacts": true,
"contract": true
},
"plugins": [
"prettier",
"security",
"@typescript-eslint",
"chai-friendly"
],
"settings": {
"import/resolver": {
"typescript": {},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": 0,
"chai-friendly/no-unused-expressions": 2,
"comma-dangle": ["error", "always-multiline"],
"dot-notation": 0,
"function-paren-newline": 0,
"max-len": ["error", { "code": 150 }],
"no-confusing-arrow": 0,
"no-console": 0,
"no-else-return": 0,
"no-multiple-empty-lines": ["error", { "max": 3 }],
"no-param-reassign": 0,
"no-unused-expressions": 0,
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-use-before-define": 0,
"object-curly-newline": ["error", { "consistent": true }],
"object-shorthand": 0,
"padded-blocks": 0,
"prefer-destructuring": 0,
"prettier/prettier": "error",
"quote-props": ["error", "as-needed"],
"strict": 0,
"no-undef": "off",
"no-await-in-loop": "off",
"import/no-extraneous-dependencies": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
}
}
1 change: 1 addition & 0 deletions contracts/erc3643/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
57 changes: 57 additions & 0 deletions contracts/erc3643/.github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Beta Package

on:
release:
types: [published]

jobs:
build:
if: 'github.event.release.prerelease'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run build
- name: Run test coverage
run: npm run coverage
- name: Zip coverage results
run: zip -r coverage.zip "coverage/" "coverage.json"
- name: Upload artifacts to release
uses: softprops/action-gh-release@v1
if: ${{startsWith(github.ref, 'refs/tags/') }}
with:
files: coverage.zip

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
scope: '@tokenysolutions'
- run: npm ci
- run: npm run build
- run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
57 changes: 57 additions & 0 deletions contracts/erc3643/.github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Release Package

on:
release:
types: [published]

jobs:
build:
if: '!github.event.release.prerelease'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run build
- name: Run test coverage
run: npm run coverage
- name: Zip coverage results
run: zip -r coverage.zip "coverage/" "coverage.json"
- name: Upload artifacts to release
uses: softprops/action-gh-release@v1
if: ${{startsWith(github.ref, 'refs/tags/') }}
with:
files: coverage.zip

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
scope: '@tokenysolutions'
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
53 changes: 53 additions & 0 deletions contracts/erc3643/.github/workflows/push_checking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test workflow
on: pull_request
jobs:
lint:
name: Lint sources
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout
uses: 'actions/checkout@master'

- name: Set Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Lint Solidity sources
run: npm run lint:sol
- name: Lint TypeScript sources
run: npm run lint:ts

unit_test:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout
uses: 'actions/checkout@master'

- name: Set Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Run test coverage
run: npm run coverage
- name: Upload coverage to action results
uses: actions/upload-artifact@v3
with:
path: |
coverage/
coverage.json
23 changes: 23 additions & 0 deletions contracts/erc3643/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules/

# Artifacts
build/
bin/
coverage/
coverage.json
typechain-types/
artifacts/
cache/
docgen/
flat/

# IDEs
.idea/
.vscode/

# NPM
gas-report
/bin/

#logs
testlog.txt
4 changes: 4 additions & 0 deletions contracts/erc3643/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

node ./scripts/commit-msg.js $1 && npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions contracts/erc3643/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions contracts/erc3643/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 150,
"singleQuote": true,
"trailingComma": "all"
}
8 changes: 8 additions & 0 deletions contracts/erc3643/.solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
skipFiles: [
"compliance/legacy",
"_testContracts",
"roles/permissioning/owner/",
"roles/permissioning/agent/",
],
};
34 changes: 34 additions & 0 deletions contracts/erc3643/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.17"],
"func-visibility": ["warn", { "ignoreConstructors": true }],
"reentrancy": "error",
"state-visibility": "error",
"quotes": ["error", "double"],
"const-name-snakecase": "error",
"contract-name-camelcase": "error",
"event-name-camelcase": "error",
"func-name-mixedcase": "error",
"func-param-name-mixedcase": "error",
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": ["error", { "strict": false }],
"use-forbidden-name": "error",
"var-name-mixedcase": "error",
"imports-on-top": "error",
"ordering": "error",
"visibility-modifier-order": "error",
"code-complexity": ["error", 7],
"function-max-lines": ["error", 50],
"max-line-length": ["error", 130],
"max-states-count": ["error", 15],
"no-empty-blocks": "error",
"no-unused-vars": "error",
"payable-fallback": "error",
"constructor-syntax": "error",
"not-rely-on-time": "off",
"reason-string": "off",
"no-global-import": "off"
},
"plugins": ["prettier"]
}
1 change: 1 addition & 0 deletions contracts/erc3643/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
contracts/_testContracts
Loading