Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK #206

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,23 @@ veascan-subgraph-inbox/generated/*
veascan-subgraph-inbox/build/*
validator-subgraph-inbox/generated/*
validator-subgraph-inbox/build/*

# Hardhat files
cache
artifacts
coverage.json

## Hardhat typechain bindings/types
typechain
typechain/**
typechain-types
typechain-types/**

# Hardhat deploy files
contracts/deployments/localhost
contracts/deployments/hardhat
contracts/deployments/*/solcInputs/

# POA solidity flattener output
out/

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ As long as there is one honest participant running a working implementation of t

##### ⚖️ [VeaScan explorer](https://veascan.io)

##### 📦 NPM Packages

- [@kleros/vea-sdk](https://www.npmjs.com/package/@kleros/vea-sdk)
- [@kleros/vea-contracts](https://www.npmjs.com/package/@kleros/vea-contracts)

##### 🗃️ Subgraph endpoints

- [Inbox for VeaScan](veascan-subgraph-inbox/README.md#deployments)
Expand All @@ -78,10 +83,10 @@ As long as there is one honest participant running a working implementation of t
| **[relayer-subgraph-inbox](/relayer-subgraph-inbox)** | Indexing of the bridge inbox for relaying purposes, in particular for the computation of the proof of inclusion of a message in a state root. |
| **[services](/services)** | Supporting services such as a graph-node container. |
| **[validator-cli](/validator-cli)** | Validator implementation in TypeScript capable of fulfilling the roles of Oracle and Challenger. |
| **[vea-sdk](/vea-sdk)** | SDK for the developers of cross-chain apps on Vea. |
| **[veascan-subgraph-inbox](/veascan-subgraph-inbox)** | Indexing of the bridge inbox for retrieval by the Veascan frontend. |
| **[veascan-subgraph-outbox](/veascan-subgraph-outbox)** | Indexing of the bridge outbox for retrieval by the Veascan frontend. |
| **[veascan-web](/veascan-web)** | Explorer of snapshot and messages crossing the bridge. |
| | |

## Toolchain:

Expand Down
181 changes: 0 additions & 181 deletions contracts/.gitignore

This file was deleted.

8 changes: 6 additions & 2 deletions contracts/.npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# NOP, just force npm to disregard .gitignore
# https://docs.npmjs.com/cli/v9/using-npm/developers#keeping-files-out-of-your-package
.env*
scripts
deploy
tsconfig.json
test
hardhat.config.*
31 changes: 24 additions & 7 deletions contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "@kleros/vea-contracts",
"version": "0.1.14",
"version": "0.3.2",
"description": "Smart contracts for Vea",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/kleros/vea.git"
Expand Down Expand Up @@ -32,7 +35,7 @@
},
"scripts": {
"build": "hardhat compile",
"clean": "hardhat clean",
"clean": "hardhat clean && rm -rf dist typechain-types",
"check": "hardhat check",
"test": "TS_NODE_TRANSPILE_ONLY=1 hardhat test",
"start": "hardhat node --tags nothing",
Expand All @@ -44,9 +47,10 @@
"size": "hardhat size-contracts --no-compile",
"watch": "hardhat watch",
"docgen": "hardhat docgen",
"release:patch": "scripts/publish.sh patch",
"release:minor": "scripts/publish.sh minor",
"release:major": "scripts/publish.sh major"
"release:patch": "yarn version patch && yarn npm publish",
"release:minor": "yarn version minor && yarn npm publish",
"release:major": "yarn version major && yarn npm publish",
"prepublish": "./scripts/prepublish.sh"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
Expand Down Expand Up @@ -75,7 +79,6 @@
"json-schema": "^0.4.0",
"mocha": "^10.2.0",
"node-fetch": "^3.3.1",
"shelljs": "^0.8.5",
"solhint": "^3.4.1",
"solidity-coverage": "^0.8.2",
"ts-node": "^10.9.1",
Expand All @@ -84,5 +87,19 @@
},
"dependencies": {
"@openzeppelin/contracts": "^4.8.3"
}
},
"files": [
"src",
"deployments",
"typechain-types",
"!hardhat.config.*",
"!src/test",
"!typechain-types/test",
"!typechain-types/factories/test",
"!test",
"!deploy",
"!deployments/localhost",
"!deployments/hardhat",
"!deployments/**/solcInputs"
]
}
12 changes: 12 additions & 0 deletions contracts/scripts/prepublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# Remove the mock contracts from the typechain types
sed -n -i '' '/test/!p' $SCRIPT_DIR/../typechain-types/index.ts
sed -n -i '' '/test/!p' $SCRIPT_DIR/../typechain-types/factories/index.ts
rm -rf \
$SCRIPT_DIR/../typechain-types/test/ \
$SCRIPT_DIR/../typechain-types/factories/test/

yarn tsc -p $SCRIPT_DIR/../tsconfig.publish.json
32 changes: 0 additions & 32 deletions contracts/scripts/publish.sh

This file was deleted.

7 changes: 6 additions & 1 deletion contracts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"declaration": true,
"sourceMap": true,
"noImplicitAny": false,
"resolveJsonModule": true
"resolveJsonModule": true,
"skipLibCheck": true
},
"include": [
"./src",
Expand All @@ -17,6 +18,10 @@
"./typechain-types",
"./deploy"
],
"exclude": [
"node_modules",
"dist"
],
"files": [
"./hardhat.config.ts"
]
Expand Down
21 changes: 21 additions & 0 deletions contracts/tsconfig.publish.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "es2021",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "typechain-types",
"declaration": true,
"sourceMap": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"skipLibCheck": true
},
"include": [
"./typechain-types"
],
"exclude": [
"node_modules",
"dist"
]
}
Loading