Skip to content

Commit

Permalink
publish npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNi245 committed Jan 27, 2024
1 parent 1d264df commit 3e3d985
Show file tree
Hide file tree
Showing 10 changed files with 996 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ typechain-types
cache
artifacts

dist
6 changes: 6 additions & 0 deletions abi/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Blake2s__factory } from "../typechain-types";


export default {
Blake2s: Blake2s__factory.abi
}
1 change: 0 additions & 1 deletion contracts/Blake2s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ library Blake2s {
BLAKE2s_ctx memory ctx;
uint32[8] memory out;
uint32[2] memory DEFAULT_EMPTY_INPUT;

init(
ctx,
DEFAULT_OUTLEN,
Expand Down
7 changes: 4 additions & 3 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-ethers";
import "@nomicfoundation/hardhat-toolbox";
import "hardhat-gas-reporter"


Expand All @@ -13,13 +14,13 @@ const config: HardhatUserConfig = {
timeout: 100000000000
},
networks: {
hardhat:{
hardhat: {
gas: 30000000,
blockGasLimit: 30000000,
}
}


};

export default config;
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Blake2s = require("./artifacts/contracts/Blake2s.sol/Blake2s.json");

module.exports = {
Blake2s,
};
33 changes: 26 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{
"name": "hardhat-project",
"name": "blake2s-solidity",
"version": "0.1.0",
"description": "Blake2s hash function for Solidity",
"author": "Alex Plutta - [email protected]",
"license": "MIT",
"scripts": {
"test": "hardhat test"
"test": "hardhat test",
"build": "yarn hardhat compile && yarn hardhat typechain && yarn tsc -p tsconfig-build.json"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@openzeppelin/contracts": "^4.6.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.0.0",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"chai": "^4.3.7",
Expand All @@ -15,11 +26,19 @@
"hardhat": "^2.12.4",
"hardhat-gas-reporter": "^1.0.9",
"mocha": "^10.2.0",
"solidity-coverage": "^0.8.1",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"zksync-ethers": "^6.0.0"
"typechain": "^8.3.0",
"typescript": "^4.9.5"
},
"dependencies": {
"blake2s": "^1.1.0"
}
"files": [
"dist",
"LICENSE",
"README.md",
"build",
"contracts/**/*.sol",
"abi",
"artifacts",
"typechain"
]
}
3 changes: 1 addition & 2 deletions test/Blake2s.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

import { expect } from "chai";
import crypto from 'crypto';
import { Contract, JsonRpcProvider, toUtf8Bytes } from "ethers";
import { toUtf8Bytes } from "ethers";
import { ethers } from "hardhat";
import { Blake2s } from "../typechain-types";

describe("Blake2s", function () {
let blake2s: any;
Expand Down
21 changes: 21 additions & 0 deletions tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "CommonJS",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"outDir": "dist",
"sourceMap": true
},
"include": ["abi","contracts"],
"exclude": ["**/*.test.ts"]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true
"resolveJsonModule": true,

}
}
Loading

0 comments on commit 3e3d985

Please sign in to comment.