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
5 changes: 1 addition & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.15.0]
node-version: [22.22.2]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Setup DVC
uses: iterative/setup-dvc@v1

- name: Fetch submodules
run: git submodule update --init --recursive

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
if: github.ref != 'refs/heads/main' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [18.15.x]
node-version: [22.22.2]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 18.x
- name: Setup Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 18.15.x
node-version: 22.22.2

- name: Install Dependencies
run: yarn
Expand All @@ -44,4 +44,4 @@ jobs:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: 'Webb-Bot'
SLACK_CHANNEL: '#webb-protocol-solidity'
SLACK_MESSAGE: 'A new version of ${GITHUB_REPOSITORY} packages was published!'
SLACK_MESSAGE: 'A new version of ${GITHUB_REPOSITORY} packages was published!'
6 changes: 4 additions & 2 deletions .github/workflows/publish-ts-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ jobs:

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 22.22.2

- name: Install dependencies
- run: git submodule update --init --recursive
- run: cd solidity-fixtures && dvc pull && cd ..
- run: yarn fetch:fixtures
- run: yarn install --production=false
- run: yarn compile
- run: yarn build:packages
Expand All @@ -43,4 +45,4 @@ jobs:
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: ./packages/protocol-solidity/docs
folder: ./packages/protocol-solidity/docs
13 changes: 5 additions & 8 deletions .github/workflows/test-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.15.0]
node-version: [22.22.2]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -37,7 +37,7 @@ jobs:
run: lerna run build

- name: Upload build artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
Expand All @@ -53,11 +53,11 @@ jobs:
if: github.ref != 'refs/heads/main' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [18.15.0]
node-version: [22.22.2]
steps:
- uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: packages
Expand All @@ -66,9 +66,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Setup DVC
uses: iterative/setup-dvc@v1

- name: Fetch submodules
run: git submodule update --init --recursive

Expand All @@ -81,4 +78,4 @@ jobs:
- name: Run test suite
env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
run: yarn test
run: yarn test
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
url = https://github.com/PaulRBerg/prb-test
[submodule "solidity-fixtures"]
path = solidity-fixtures
url = https://github.com/webb-tools/solidity-fixtures.git
url = https://github.com/tangle-network/protocol-solidity-fixtures.git
39 changes: 34 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
]
},
"engines": {
"node": "18.x.x"
"node": ">=22.9.0"
},
"scripts": {
"compile": "lerna run compile --scope=@webb-tools/contracts",
Expand All @@ -26,7 +26,7 @@
"build:ptau": "./scripts/bash/generate_phase1_ptau.sh",
"clean": "rm -rf artifacts typechain-types && yarn clean:packages",
"clean:packages": "lerna run clean",
"fetch:fixtures": "cd solidity-fixtures && dvc pull && cd ../",
"fetch:fixtures": "test -f solidity-fixtures/fixtures/vanchor_2/2/poseidon_vanchor_2_2.wasm && ln -sfn fixtures solidity-fixtures/solidity-fixtures",
"prettier": "prettier -c .",
"publish:packages": "lerna run compile && lerna publish",
"publish:ci": "lerna run compile && lerna publish patch --yes --message 'chore: release new versions' ",
Expand Down Expand Up @@ -73,17 +73,46 @@
"typescript": "^5.0.4"
},
"resolutions": {
"**/hardhat/adm-zip": "0.6.0",
"**/axios": "1.20.0",
"**/@types/minimatch/minimatch/brace-expansion": "5.0.9",
"**/@tufjs/models/minimatch/brace-expansion": "5.0.9",
"**/@sigstore/sign/make-fetch-happen/cacache/glob/minimatch/brace-expansion": "5.0.9",
"**/minimatch/brace-expansion": "2.1.4",
"**/fast-uri": "3.1.5",
"**/axios/form-data": "4.0.6",
"**/request/form-data": "2.5.6",
"@ethersproject/signing-key": "5.8.0",
"@tootallnate/once": "3.0.1",
"cookie": "1.1.1",
"es5-ext": "0.10.64",
"handlebars": "4.7.9",
"ip": "2.0.1",
"**/immutable": "4.3.9",
"**/ip-address": "10.3.1",
"**/nx/js-yaml": "4.3.1",
"**/lerna/js-yaml": "4.3.1",
"**/mocha/js-yaml": "4.3.1",
"**/solidity-coverage/sc-istanbul/js-yaml": "3.15.1",
"**/lerna/minimatch": "3.1.5",
"**/nx/minimatch": "3.1.5",
"**/@lerna/legacy-package-management/minimatch": "3.1.5",
"**/@lerna/legacy-package-management/semver": "7.8.5",
"on-headers": "1.1.0",
"qs": "6.15.1",
"**/mocha/serialize-javascript": "7.0.3",
"secp256k1": "4.0.4",
"tmp": "0.2.5",
"**/pacote/sigstore": "4.1.1",
"**/libnpmpublish/sigstore": "4.1.1",
"**/pacote/tar": "7.5.22",
"**/lerna/tar": "7.5.22",
"**/@lerna/legacy-package-management/tar": "7.5.22",
"**/tar": "7.5.22",
"tmp": "0.2.7",
"undici": "5.29.0",
"webpack": "5.106.2"
"webpack": "5.106.2",
"**/ethers/@ethersproject/providers/ws": "8.21.0",
"**/hardhat-gas-reporter/viem/ws": "8.21.0",
"hardhat/ws": "7.5.11",
"**/swarm-js/eth-lib/ws": "5.2.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ contract FungibleTokenWrapperTest is PRBTest, StdCheats {
}

function test_setFee(uint16 feePercentage) public {
vm.assume(feePercentage <= 10000);
vm.assume(feePercentage < 10000);
assertEq(token.proposalNonce(), 0);
vm.prank(alice);
token.setFee(feePercentage, 1);
Expand Down
3 changes: 3 additions & 0 deletions packages/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
hardhat: {
hardfork: 'cancun',
allowUnlimitedContractSize: true,
blockGasLimit: 30_000_000,
gas: 30_000_000,
accounts: HARDHAT_ACCOUNTS,
},
},
Expand Down
3 changes: 2 additions & 1 deletion packages/contracts/test/create2/create2.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ethers, assert } from 'hardhat';
import { ethers } from 'hardhat';
import { assert } from 'chai';
import { HARDHAT_ACCOUNTS } from '../../hardhatAccounts.js';

import {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"@metamask/eth-sig-util": "^6.0.0",
"@polkadot/util": "^9.7.2",
"big-integer": "^1.6.52",
"circomlibjs": "^0.0.8",
"ethers": "5.8.0",
Expand All @@ -28,7 +29,6 @@
"version": "1.1.1",
"gitHead": "e1f3b300b6e004ac5a346dc0458bb1d303969d97",
"devDependencies": {
"@webb-tools/sdk-core": "0.1.8",
"chai": "^4.3.7"
},
"exports": {
Expand Down
74 changes: 1 addition & 73 deletions packages/utils/src/__test__/utxo.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from 'chai';
import { Keypair } from '../protocol/keypair';
import { Utxo } from '../protocol/utxo';
import { Utxo as SdkCoreUtxo } from '@webb-tools/sdk-core';
import { u8aToHex, hexToU8a } from '..';
import { u8aToHex } from '..';

describe('Utxo Class', () => {
it('should construct with params', async function () {
Expand Down Expand Up @@ -95,77 +94,6 @@ describe('Utxo Class', () => {
expect(utxoString).to.deep.equal(serializedUtxo);
});

it('Utxo and SdkCoreUtxo should generate compatible outputs public utxo', async function () {
const keypair = Keypair.fromString(
'0x1111111111111111111111111111111111111111111111111111111111111111'
);
const blinding = hexToU8a(
'0x17415b69c56a3c3897dcb339ce266a0f2a70c9372a6fec1676f81ddaf68e9926',
256
);

const sdkCoreUtxo = await SdkCoreUtxo.generateUtxo({
amount: '1000000000',
backend: 'Arkworks',
blinding,
chainId: '2199023256632',
curve: 'Bn254',
index: '0',
keypair: keypair as unknown as any,
});
const utxo = Utxo.generateUtxo({
amount: '1000000000',
backend: 'Circom',
blinding,
chainId: '2199023256632',
curve: 'Bn254',
index: '0',
keypair,
});

expect(utxo.amount).to.deep.equal(sdkCoreUtxo.amount);
expect(utxo.chainId).to.deep.equal(sdkCoreUtxo.chainId);
expect(utxo.public_key).to.deep.equal(sdkCoreUtxo.public_key);
expect(utxo.blinding).to.deep.equal(sdkCoreUtxo.blinding);
expect(utxo.commitment).to.deep.equal(sdkCoreUtxo.commitment);
});

it('Utxo and SdkCoreUtxo should generate compatible outputs private utxo', async function () {
const keypair = new Keypair();
const blinding = hexToU8a(
'0x17415b69c56a3c3897dcb339ce266a0f2a70c9372a6fec1676f81ddaf68e9926',
256
);

const sdkCoreUtxo = await SdkCoreUtxo.generateUtxo({
amount: '1000000000',
backend: 'Arkworks',
blinding,
chainId: '2199023256632',
curve: 'Bn254',
index: '0',
keypair: keypair as unknown as any,
});
const utxo = Utxo.generateUtxo({
amount: '1000000000',
backend: 'Circom',
blinding,
chainId: '2199023256632',
curve: 'Bn254',
index: '0',
keypair,
});

expect(utxo.amount).to.deep.equal(sdkCoreUtxo.amount);
expect(utxo.chainId).to.deep.equal(sdkCoreUtxo.chainId);
expect(utxo.keypair.toString()).to.deep.equal(sdkCoreUtxo.keypair.toString());
expect(utxo.public_key).to.deep.equal(sdkCoreUtxo.public_key);
expect(utxo.secret_key).to.deep.equal(sdkCoreUtxo.secret_key);
expect(utxo.blinding).to.deep.equal(sdkCoreUtxo.blinding);
expect(utxo.commitment).to.deep.equal(sdkCoreUtxo.commitment);
expect(utxo.nullifier).to.deep.equal(sdkCoreUtxo.nullifier);
});

it('Check valid encryption length', async function () {
const kp = new Keypair();

Expand Down
1 change: 1 addition & 0 deletions solidity-fixtures
Submodule solidity-fixtures added at 110ade
Loading
Loading