Skip to content

Commit

Permalink
Fix issues with Vite demo - 'ethers' as dependency, use correct 'isBi…
Browse files Browse the repository at this point in the history
…gNumber'
  • Loading branch information
forshtat committed Aug 10, 2023
1 parent 9b7fa9a commit a245de8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/common/src/web3js/Web3JSUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import BN from 'bn.js'
import numberToBN from 'number-to-bn'
import ethjsUnit from 'ethjs-unit'
import { BigNumber } from '@ethersproject/bignumber'

/**
* Takes an input and transforms it into an BN
Expand Down Expand Up @@ -51,7 +52,7 @@ export var toHex = function (value, returnType?: any) {
return '0x' + value.toString('hex')
}

if (typeof value === 'object' && !!value && !isBigNumber(value) && !isBN(value)) {
if (typeof value === 'object' && !!value && !BigNumber.isBigNumber(value) && !isBN(value)) {
return returnType ? 'string' : utf8ToHex(JSON.stringify(value))
}

Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"access": "public"
},
"dependencies": {
"@openzeppelin/contracts": "^4.2.0",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/providers": "^5.7.2"
"@ethersproject/providers": "^5.7.2",
"@openzeppelin/contracts": "^4.2.0",
"ethers": "^5.7.2"
},
"devDependencies": {
"ethers": "^5.7.2",
"solc-0.8": "npm:[email protected]",
"solhint": "^3.3.2",
"solidity-docgen": "^0.5.16",
Expand Down

0 comments on commit a245de8

Please sign in to comment.