Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ artifacts
cache
./**/*.sol
typechain
typechainV6
package
20 changes: 12 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ jobs:
with:
node-version: "lts/*"
- name: Install dependencies
run: yarn install --frozen-lockfile
run: |
yarn install --frozen-lockfile
yarn --cwd package install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Test
run: yarn test:src && yarn test:contracts
- name: Build project
run: |
yarn build:contracts
yarn build:src
yarn lint
yarn --cwd package lint
- name: Build project
run: yarn package:update
- name: Test
run: yarn test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
run: |
cd package
npx semantic-release
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- name: Check contract sizes
run: yarn hardhat size-contracts
- name: Test
run: yarn test:src && yarn test:contracts
run: yarn yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ cache
typechain
typechainV6
network/volumes
deployments/localhost
5 changes: 4 additions & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"*.{ts,js}": ["prettier --write", "eslint --config ./.eslintrc --ignore-path ./.eslintignore --cache --fix"],
"*.{ts,js}": [
"prettier --write",
"eslint --config ./.eslintrc --ignore-path ./.eslintignore --cache --fix"
],
"*.md": ["prettier --write"]
}
40 changes: 4 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,7 @@
"Kostiantyn Smyrnov <kostysh@gmail.com>"
],
"license": "MIT",
"private": false,
"types": "./lib/src/index.d.ts",
"main": "./lib/src/index.js",
"files": [
"lib/src/*",
"lib/artifacts/*",
"lib/typechain/*",
"!**/*.tsbuildinfo",
"!**/**.dbg.json"
],
"release": {
"branches": [
{
"name": "main"
},
{
"name": "beta",
"channel": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/changelog",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
},
"publishConfig": {
"access": "public"
},
"private": true,
"devDependencies": {
"@types/node": "^18.15.11",
"@types/mocha": "^10.0.1",
Expand Down Expand Up @@ -96,10 +65,9 @@
"@openzeppelin/contracts-upgradeable": "^4.8.3"
},
"scripts": {
"build:contracts": "hardhat compile",
"build:src": "rm -rf ./lib && typechain --target=ethers-v6 --out-dir typechainV6 ./artifacts/contracts/Config.sol/Config.json ./artifacts/contracts/EntitiesRegistry.sol/EntitiesRegistry.json ./artifacts/contracts/Market.sol/Market.json && tsc -p ./tsconfig.build.json",
"test:contracts": "hardhat test",
"test:src": "mocha -t 60000 --extension spec.ts test/src",
"build": "hardhat compile",
"package:update": "rm -rf ./package/typechain ./package/artifacts && yarn build && cp -r ./artifacts ./package/artifacts && cp ./README.md ./package/README.md && yarn --cwd ./package build",
"test": "hardhat test",
"lint": "solhint . && eslint --ext .ts",
"lint:fix": "eslint --ext .ts --fix && solhint --fix . && prettier --check !network --write .",
"coverage": "npx hardhat coverage",
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions package/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Winding Tree

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
38 changes: 38 additions & 0 deletions package/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[![@windingtree/contracts](https://img.shields.io/npm/v/@windingtree/contracts)](https://www.npmjs.com/package/@windingtree/contracts)
[![Beta Release](https://github.com/windingtree/contracts/actions/workflows/release.yml/badge.svg?branch=beta)](https://github.com/windingtree/contracts/actions/workflows/release.yml)

# @windingtree/contracts

The WindingTree market protocol smart contracts and utilities

## Deployments

### Polygon zkEVM

- Config ([0x098b1d12cAfE7315C77b6d308A62ce02806260Ee](https://explorer.public.zkevm-test.net/address/0x098b1d12cAfE7315C77b6d308A62ce02806260Ee/read-proxy#address-tabs)): the protocol configuration smart contract
- EntitiesRegistry ([0x4bB51528C83844b509E1152EEb05260eE1bf60e6](https://explorer.public.zkevm-test.net/address/0x4bB51528C83844b509E1152EEb05260eE1bf60e6/read-proxy#address-tabs)): the protocol identity management
- Market ([0xDd5B6ffB3585E109ECddec5293e31cdc1e9DeD57](https://explorer.public.zkevm-test.net/address/0xDd5B6ffB3585E109ECddec5293e31cdc1e9DeD57/read-proxy#address-tabs)): the protocol entry point
- LIF ([0xba515AB7FfDa899a2e6c8FDbcDf351c8c15f4009](https://explorer.public.zkevm-test.net/address/0xba515AB7FfDa899a2e6c8FDbcDf351c8c15f4009/read-proxy#address-tabs)): Test version of LIF token

## Install package

```bash
yarn add @windingtree/contracts
```

## Setup

```bash
yarn
yarn build:contracts
```

## Testing

```bash
yarn test:contracts
```

## Contributing

[Contribution guidelines](https://windingtree.github.io/sdk/#/docs/contribution)
98 changes: 98 additions & 0 deletions package/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"name": "@windingtree/contracts",
"version": "0.0.0-semantic-release",
"description": "The WindingTree market protocol smart contracts and utilities",
"repository": "git@github.com:windingtree/contracts.git",
"bugs": "https://github.com/windingtree/contracts/issues",
"homepage": "https://github.com/windingtree/contracts#readme",
"author": "Kostiantyn Smyrnov <kostysh@gmail.com>",
"keywords": [
"windingtree",
"market",
"protocol",
"solidity",
"typescript",
"contract",
"smart contract"
],
"contributors": [
"Kostiantyn Smyrnov <kostysh@gmail.com>"
],
"license": "MIT",
"private": false,
"types": "./lib/src/index.d.ts",
"main": "./lib/src/index.js",
"files": [
"src",
"lib",
"artifacts",
"typechain",
"!**/*.tsbuildinfo",
"!**/**.dbg.json"
],
"typesVersions": {
"*": {
"*": [
"*",
"lib/*",
"lib/*/index"
]
}
},
"exports": {
".": {
"types": "./lib/src/index.d.ts",
"import": "./lib/src/index.js"
},
"./types": {
"types": "./lib/typechain/index.d.ts",
"import": "./lib/typechain/index.js"
}
},
"release": {
"branches": [
{
"name": "main"
},
{
"name": "beta",
"channel": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/changelog",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@types/node": "^20.1.5",
"semantic-release": "^21.0.2",
"semantic-release-cli": "^5.4.4",
"@semantic-release/changelog": "^6.0.3",
"@commitlint/config-conventional": "^17.6.3",
"@commitlint/cli": "^17.6.3",
"lint-staged": "^13.2.2",
"eslint": "^8.40.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"prettier": "^2.8.8",
"prettier-plugin-jsdoc": "^0.4.2",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"ethers": "^6.3.0",
"typechain": "^8.1.1",
"@typechain/ethers-v6": "^0.3.2"
},
"scripts": {
"build": "rm -rf ./lib && typechain --target=ethers-v6 --out-dir typechain ./artifacts/contracts/Config.sol/Config.json ./artifacts/contracts/EntitiesRegistry.sol/EntitiesRegistry.json ./artifacts/contracts/Market.sol/Market.json && tsc -p ./tsconfig.build.json",
"lint": "eslint --ext .ts",
"lint:fix": "eslint --ext .ts --fix && prettier --check !network --write ."
}
}
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions package/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./lib"
}
}
23 changes: 23 additions & 0 deletions package/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": ["DOM.Iterable"],
"target": "ES2022",
"module": "CommonJS",
"moduleResolution": "node",
"skipLibCheck": true,
"checkJs": true,
"allowJs": true,
"declaration": true,
"declarationMap": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"noErrorTruncation": true,
"forceConsistentCasingInFileNames": true,
"useUnknownInCatchVariables": true,
"importsNotUsedAsValues": "remove",
"noImplicitReturns": true
},
"include": ["src/**/*.ts", "typechain/**/*.ts"]
}
Loading