This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor docs, makefile, scripts (#40)
* update npm packages * fix --legacy-peer-deps * update docs scripts * fix almost all whitespace problems * add markdownlint-cli package & settings Close #31. * finish tweaking handlebars template * docs generated * remove custody mention * restore solhint & solhint-plugin-prettier Closes #32. * fea: add extenders to md file * add structs & enums to docs template * temporarily remove helpers.ts * add readmes, vault and clearing extenders * add architecture and public readme * add helpers.js to eslintignore * fix type error after renaming * add docs to prettierignore, add prettier check * fix typos * fea: log gas fees * basic estimation & logging * estimate gas on failings * add environment variables * mark packages stable versions * tweak hardhat settings * fix version variable unaccesability * bring back solhint * working logging on vault, clearing and vesting * extract deploy clearing and vault * use requireEnv method to get env variables * add outDir env to export accounts * deployments data * fix docs script * add blockscan links to addresses Closes #38. * remove environment * remove wrong deployment tx info from deployments * implement go-bindings generation * update docs generation * remove unused PLATFORM variable * add docs about solc-select, scripts * add yellow network test deployment * minor changes to makefile * Add docs on fetching participants from Registry Closes #41. * clarify 'locally' installed * fix incorrect name of YellowClearing in drawio * run lint:fix Co-authored-by: nksazonov <nsazonov@openware.com>
- Loading branch information
Showing
106 changed files
with
14,449 additions
and
3,840 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ cache | |
coverage | ||
node_modules | ||
typechain | ||
|
||
/docs/api/templates/helpers.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"no-duplicate-heading": false, | ||
"no-multiple-blanks": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
/artifacts/ | ||
/cache/ | ||
/coverage/ | ||
coverage.json | ||
/docs/api | ||
node_modules/ | ||
typechain/ | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"code-complexity": ["error", 8], | ||
"compiler-version": ["off"], | ||
"func-visibility": ["error", { "ignoreConstructors": true }], | ||
"max-line-length": ["off"], | ||
"no-empty-blocks": "off", | ||
"not-rely-on-time": "off", | ||
"quotes": ["error", "single"], | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"endOfLine": "auto" | ||
} | ||
], | ||
"reason-string": ["warn", { "maxLength": 64 }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# directories | ||
|
||
**/artifacts | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,55 @@ | ||
.PHONY=custody | ||
.PHONY=smart-contracts | ||
|
||
ABIGEN_VERSION=1.10.11-7231b3ef | ||
ABIGEN_FILE=geth-alltools-linux-amd64-$(ABIGEN_VERSION) | ||
ABIGEN_URL=https://gethstore.blob.core.windows.net/builds/$(ABIGEN_FILE).tar.gz | ||
ABIGEN_VERSION = 1.10.26-e5eb32ac | ||
SOLC_VERSION = 0.8.16 | ||
|
||
fetch-abigen: | ||
mkdir -p cache | ||
curl -L https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-$(ABIGEN_VERSION).tar.gz -o cache/geth-alltools.tar.gz | ||
tar zxvf cache/geth-alltools.tar.gz --directory cache --strip-components=1 | ||
chmod +x cache/abigen | ||
OUT_DIR = ./bindings/ | ||
|
||
abigen: | ||
./cache/abigen --abi abi/contracts/custody/IVault.sol/IVault.json --pkg vault --type IVault --out IVault.go | ||
./cache/abigen --abi abi/contracts/nitro-ptorocol/NitroAdjudicator.sol/NitroAdjudicator.json --pkg nitro --type NitroAdjudicator --out NitroAdjudicator.go | ||
CACHE_DIR = ./cache | ||
|
||
compile: | ||
npm i | ||
npx hardhat compile | ||
SOLC_BIN = ${CACHE_DIR}/solc | ||
ABIGEN_BIN = ${CACHE_DIR}/abigen | ||
|
||
custody: compile fetch-abigen abigen | ||
install-solc-lin: | ||
mkdir -p ${CACHE_DIR} | ||
curl -L https://github.com/ethereum/solidity/releases/download/v${SOLC_VERSION}/solc-static-linux -o ${SOLC_BIN} | ||
chmod +x ${SOLC_BIN} | ||
|
||
test: | ||
npx hardhat test | ||
install-solc-mac: | ||
mkdir -p ${CACHE_DIR} | ||
curl -L https://github.com/ethereum/solidity/releases/download/v${SOLC_VERSION}/solc-macos -o ${SOLC_BIN} | ||
chmod +x ${SOLC_BIN} | ||
|
||
install-abigen-lin: | ||
mkdir -p ${CACHE_DIR} | ||
curl -L https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-$(ABIGEN_VERSION).tar.gz -o ${CACHE_DIR}/geth-alltools.tar.gz | ||
tar zxvf ${CACHE_DIR}/geth-alltools.tar.gz --directory ${CACHE_DIR} --strip-components=1 geth-alltools-linux-amd64-$(ABIGEN_VERSION)/abigen | ||
rm -r ${CACHE_DIR}/geth-alltools.tar.gz | ||
chmod +x ${ABIGEN_BIN} | ||
|
||
install-abigen-mac: | ||
mkdir -p ${CACHE_DIR} | ||
curl -L https://gethstore.blob.core.windows.net/builds/geth-alltools-darwin-amd64-$(ABIGEN_VERSION).tar.gz -o ${CACHE_DIR}/geth-alltools.tar.gz | ||
tar zxvf ${CACHE_DIR}/geth-alltools.tar.gz --directory ${CACHE_DIR} --strip-components=1 geth-alltools-darwin-amd64-$(ABIGEN_VERSION)/abigen | ||
rm -r ${CACHE_DIR}/geth-alltools.tar.gz | ||
chmod +x ${ABIGEN_BIN} | ||
|
||
solc-all: | ||
${SOLC_BIN} --combined-json abi,bin --base-path . --include-path ./node_modules -o ${CACHE_DIR}/solcoutput/YellowClearingV1 contracts/clearing/YellowClearingV1.sol --overwrite | ||
${SOLC_BIN} --combined-json abi,bin --base-path . --include-path ./node_modules -o ${CACHE_DIR}/solcoutput/VaultImplV1 contracts/vault/VaultImplV1.sol --overwrite | ||
|
||
abigen-all: | ||
mkdir -p ${OUT_DIR} | ||
${ABIGEN_BIN} --combined-json ${CACHE_DIR}/solcoutput/YellowClearingV1/combined.json --pkg YellowClearing --type Contract --out ${OUT_DIR}YellowClearing.go | ||
${ABIGEN_BIN} --combined-json ${CACHE_DIR}/solcoutput/VaultImplV1/combined.json --pkg Vault --type Contract --out ${OUT_DIR}Vault.go | ||
|
||
# require changed `SOLC_BIN` and `ABIGEN_BIN` | ||
bindings-local: solc-all abigen-all | ||
|
||
bindings-lin: install-solc-lin solc-all install-abigen-lin abigen-all | ||
|
||
bindings-mac: install-solc-mac solc-all install-abigen-mac abigen-all | ||
|
||
bindings-cache: solc-all abigen-all | ||
|
||
bindings-docker: install-solc-lin solc-all install-abigen-lin abigen-all |
Oops, something went wrong.