Skip to content

Commit 2799d0c

Browse files
Update to [email protected], [email protected], [email protected] & volta-cli/action@v4 (#577)
* Pin [email protected] * Update to volta-cli/actions@v4 * Add @ethersproject/bytes to contracts-core * Add postinstall script in contracts-core * Add --sequential flag to lerna run prepare * Add --stream flag to lerna run prepare * Add --concurrency 1 flag to lerna run prepare * Update typechain * Replace typechain-hardhat package * Update Umbra.ts and add hardhat --verbose flag * Upgrade hardhat & use new typechain naming for import * Remove bytes library and --verbose flag * Remove extra alias * Remove --concurrency 1 flag Co-authored-by: wildmolasses <[email protected]> * Use pinned version of [email protected] in umbra-js * Use typechain factories instead of type casting --------- Co-authored-by: wildmolasses <[email protected]>
1 parent 789b623 commit 2799d0c

File tree

8 files changed

+197
-148
lines changed

8 files changed

+197
-148
lines changed

Diff for: .github/workflows/ci.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
submodules: recursive
3232

33-
- uses: volta-cli/action@v1
33+
- uses: volta-cli/action@v4
3434

3535
- name: Install Foundry
3636
uses: onbjerg/foundry-toolchain@v1
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
submodules: recursive
4949

50-
- uses: volta-cli/action@v1
50+
- uses: volta-cli/action@v4
5151

5252
- name: Install Foundry
5353
uses: onbjerg/foundry-toolchain@v1
@@ -66,7 +66,7 @@ jobs:
6666
with:
6767
submodules: recursive
6868

69-
- uses: volta-cli/action@v1
69+
- uses: volta-cli/action@v4
7070

7171
- name: Install Foundry
7272
uses: onbjerg/foundry-toolchain@v1
@@ -121,7 +121,7 @@ jobs:
121121
with:
122122
submodules: recursive
123123

124-
- uses: volta-cli/action@v1
124+
- uses: volta-cli/action@v4
125125

126126
- name: Install Foundry
127127
uses: onbjerg/foundry-toolchain@v1

Diff for: contracts-core/hardhat.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import '@nomiclabs/hardhat-web3';
1212
import '@nomiclabs/hardhat-truffle5';
1313
import '@nomiclabs/hardhat-ethers';
1414
import '@nomiclabs/hardhat-etherscan';
15-
import 'hardhat-typechain';
15+
import '@typechain/hardhat';
1616
import 'solidity-coverage';
1717
import 'hardhat-gas-reporter';
1818

Diff for: contracts-core/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
"@openzeppelin/test-helpers": "^0.5.10",
1919
"@truffle/debug-utils": "^4.1.1",
2020
"@typechain/ethers-v5": "^10.2.0",
21+
"@typechain/hardhat": "^8.0.3",
2122
"@types/chai": "^4.2.13",
2223
"@types/fs-extra": "^9.0.1",
2324
"@types/mocha": "^7.0.2",
24-
"@types/node": "^14.11.8",
25+
"@types/node": "^18.17.0",
2526
"chai": "^4.2.0",
2627
"commitizen": "^4.2.1",
2728
"concurrently": "^5.3.0",
@@ -32,9 +33,8 @@
3233
"ethereum-waffle": "^3.2.0",
3334
"ethers": "5.7.2",
3435
"fs-extra": "^9.0.1",
35-
"hardhat": "^2.6.8",
36+
"hardhat": "^2.17.1",
3637
"hardhat-gas-reporter": "^1.0.4",
37-
"hardhat-typechain": "^0.3.3",
3838
"husky": "^4.3.0",
3939
"mocha": "^8.1.3",
4040
"prettier": "^2.1.2",
@@ -46,7 +46,7 @@
4646
"solidity-coverage": "^0.7.12",
4747
"ts-generator": "^0.1.1",
4848
"ts-node": "^8.10.2",
49-
"typechain": "^8.1.1",
49+
"typechain": "^8.3.1",
5050
"typescript": "^3.9.7"
5151
},
5252
"files": [

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747
},
4848
"volta": {
49-
"node": "16.15.0",
49+
"node": "18.17.0",
5050
"yarn": "1.22.18"
5151
}
5252
}

Diff for: umbra-js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"eslint-config-prettier": "^8.2.0",
4141
"eslint-plugin-chai-friendly": "^0.6.0",
4242
"eslint-plugin-import": "^2.20.2",
43-
"hardhat": "^2.12.4",
43+
"hardhat": "2.17.1",
4444
"mocha": "^8.3.2",
4545
"nyc": "^15.1.0",
4646
"ts-node": "^9.0.0",

Diff for: umbra-js/src/classes/Umbra.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import {
3333
assertSupportedAddress,
3434
getBlockNumberUserRegistered,
3535
} from '../utils/utils';
36-
import { Umbra as UmbraContract, Erc20 as ERC20 } from '@umbra/contracts-core/typechain';
37-
import { ERC20_ABI, ETH_ADDRESS, UMBRA_ABI, UMBRA_BATCH_SEND_ABI } from '../utils/constants';
36+
import { Umbra as UmbraContract, Umbra__factory, ERC20__factory } from '@umbra/contracts-core/typechain';
37+
import { ETH_ADDRESS, UMBRA_BATCH_SEND_ABI } from '../utils/constants';
3838
import type { Announcement, ChainConfig, EthersProvider, GraphFilterOverride, ScanOverrides, SendOverrides, SubgraphAnnouncement, UserAnnouncement, AnnouncementDetail, SendBatch, SendData} from '../types'; // prettier-ignore
3939

4040
// Mapping from chainId to contract information
@@ -149,7 +149,7 @@ export class Umbra {
149149
*/
150150
constructor(readonly provider: EthersProvider, chainConfig: ChainConfig | number) {
151151
this.chainConfig = parseChainConfig(chainConfig);
152-
this.umbraContract = new Contract(this.chainConfig.umbraAddress, UMBRA_ABI, provider) as UmbraContract;
152+
this.umbraContract = Umbra__factory.connect(this.chainConfig.umbraAddress, provider);
153153
if (this.chainConfig.batchSendAddress) {
154154
this.batchSendContract = new Contract(this.chainConfig.batchSendAddress, UMBRA_BATCH_SEND_ABI, provider);
155155
}
@@ -819,7 +819,7 @@ export async function assertSufficientBalance(signer: JsonRpcSigner | Wallet, to
819819
// If applicable, check that sender has sufficient token balance. ETH balance is checked on send. The isEth
820820
// method also serves to validate the token input
821821
if (!isEth(token)) {
822-
const tokenContract = new Contract(token, ERC20_ABI, signer) as ERC20;
822+
const tokenContract = ERC20__factory.connect(token, signer);
823823
const tokenBalance = await tokenContract.balanceOf(await signer.getAddress());
824824
if (tokenBalance.lt(tokenAmount)) {
825825
const providedAmount = tokenAmount.toString();

Diff for: umbra-js/test/Umbra.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import type { ChainConfig, SendBatch, UserAnnouncement } from '../src/types';
1111
import {
1212
TestToken as ERC20,
1313
Umbra as UmbraContract,
14-
TestTokenFactory as ERC20__factory,
15-
UmbraFactory as Umbra__factory,
14+
TestToken__factory as ERC20__factory,
15+
Umbra__factory,
1616
} from '@umbra/contracts-core/typechain';
1717
import { parseOverrides, assertSufficientBalance, assertValidStealthAddress } from '../src/classes/Umbra';
1818
import { UMBRA_BATCH_SEND_ABI } from '../src/utils/constants';

0 commit comments

Comments
 (0)