From 2d2585ab071443bb2b4f64a5e838b8f7f09f7e70 Mon Sep 17 00:00:00 2001 From: perryrare Date: Tue, 11 Jul 2023 21:58:59 -0400 Subject: [PATCH 01/10] feat: Migrate to ethers v6, removed 0xsequence/multicall --- doc/classes/LooksRare.LooksRare.md | 269 +++++++++--------- guides/collectionOrder.md | 4 +- guides/createMakerAsk.md | 4 +- guides/createMakerBid.md | 4 +- package.json | 5 +- src/LooksRare.ts | 45 +-- src/__tests__/eip712.test.ts | 6 +- src/__tests__/helpers/eip712.ts | 14 +- src/__tests__/helpers/setup.ts | 14 +- .../looksrare/createMakerAsk.test.ts | 4 +- .../looksrare/createMakerBid.test.ts | 12 +- src/__tests__/looksrare/createTaker.test.ts | 20 +- .../looksrare/executeCollectionOrder.test.ts | 2 +- .../executeCollectionOrderWithProof.test.ts | 2 +- .../executeMultipleTakerBids.test.ts | 2 +- .../looksrare/executeTakerAsk.test.ts | 2 +- .../looksrare/executeTakerBid.test.ts | 2 +- .../looksrare/orderValidator.test.ts | 4 +- .../looksrare/signMakerOrders.test.ts | 33 ++- src/constants/index.ts | 2 +- src/types.ts | 4 +- src/utils/Eip712MakerMerkleTree.ts | 8 +- src/utils/calls/exchange.ts | 6 +- src/utils/calls/strategies.ts | 4 +- src/utils/eip712.ts | 10 +- src/utils/encodeOrderParams.ts | 4 +- src/utils/provider.ts | 7 + src/utils/signMakerOrders.ts | 6 +- yarn.lock | 192 +++---------- 29 files changed, 299 insertions(+), 392 deletions(-) create mode 100644 src/utils/provider.ts diff --git a/doc/classes/LooksRare.LooksRare.md b/doc/classes/LooksRare.LooksRare.md index 1f30d96..95bfb83 100644 --- a/doc/classes/LooksRare.LooksRare.md +++ b/doc/classes/LooksRare.LooksRare.md @@ -15,11 +15,11 @@ LooksRare protocol main class #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `chainId` | [`ChainId`](../enums/types.ChainId.md) | Current app chain id | -| `provider` | `Provider` | Ethers provider | -| `signer?` | [`Signer`](../modules/types.md#signer) | Ethers signer | +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `chainId` | [`ChainId`](../enums/types.ChainId.md) | Current app chain id | +| `provider` | `Provider` | Ethers provider | +| `signer?` | [`Signer`](../modules/types.md#signer) | Ethers signer | | `override?` | [`Addresses`](../interfaces/types.Addresses.md) | Overrides contract addresses for hardhat setup | ## Properties @@ -30,7 +30,7 @@ LooksRare protocol main class Mapping of LooksRare protocol addresses for the current chain -___ +--- ### chainId @@ -38,7 +38,7 @@ ___ Current app chain ID -___ +--- ### provider @@ -48,10 +48,9 @@ Ethers multicall provider **`See`** - - [Ethers providers doc](https://docs.ethers.io/v5/api/providers/) - - [0xsequence multicall doc](https://github.com/0xsequence/sequence.js/tree/master/packages/multicall) +- [Ethers providers doc](https://docs.ethers.io/v5/api/providers/) -___ +--- ### signer @@ -74,11 +73,11 @@ The spender is the TransferManager. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `collectionAddress` | `string` | `undefined` | Address of the collection to be approved. | -| `approved` | `boolean` | `true` | true to approve, false to revoke the approval (default to true) | -| `overrides?` | `Overrides` | `undefined` | - | +| Name | Type | Default value | Description | +| :------------------ | :---------- | :------------ | :-------------------------------------------------------------- | +| `collectionAddress` | `string` | `undefined` | Address of the collection to be approved. | +| `approved` | `boolean` | `true` | true to approve, false to revoke the approval (default to true) | +| `overrides?` | `Overrides` | `undefined` | - | #### Returns @@ -86,7 +85,7 @@ The spender is the TransferManager. ContractTransaction -___ +--- ### approveErc20 @@ -97,11 +96,11 @@ The spender is the LooksRareProtocol contract. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `tokenAddress` | `string` | `undefined` | Address of the ERC20 to approve | -| `amount` | `BigNumber` | `constants.MaxUint256` | Amount to be approved (default to MaxUint256) | -| `overrides?` | `Overrides` | `undefined` | - | +| Name | Type | Default value | Description | +| :------------- | :---------- | :--------------------- | :-------------------------------------------- | +| `tokenAddress` | `string` | `undefined` | Address of the ERC20 to approve | +| `amount` | `BigNumber` | `constants.MaxUint256` | Amount to be approved (default to MaxUint256) | +| `overrides?` | `Overrides` | `undefined` | - | #### Returns @@ -109,7 +108,7 @@ The spender is the LooksRareProtocol contract. ContractTransaction -___ +--- ### cancelAllOrders @@ -119,11 +118,11 @@ Cancell all maker bid and/or ask orders for the current user #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `bid` | `boolean` | Cancel all bids | -| `ask` | `boolean` | Cancel all asks | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :----------- | :---------- | :-------------- | +| `bid` | `boolean` | Cancel all bids | +| `ask` | `boolean` | Cancel all asks | +| `overrides?` | `Overrides` | - | #### Returns @@ -131,7 +130,7 @@ Cancell all maker bid and/or ask orders for the current user ContractMethods -___ +--- ### cancelOrders @@ -141,10 +140,10 @@ Cancel a list of specific orders #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :----------- | :--------------- | :----------------------------- | +| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | +| `overrides?` | `Overrides` | - | #### Returns @@ -152,7 +151,7 @@ Cancel a list of specific orders ContractMethods -___ +--- ### cancelSubsetOrders @@ -162,10 +161,10 @@ Cancel a list of specific subset orders #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :----------- | :--------------- | :----------------------------- | +| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | +| `overrides?` | `Overrides` | - | #### Returns @@ -173,7 +172,7 @@ Cancel a list of specific subset orders ContractMethods -___ +--- ### createMakerAsk @@ -183,8 +182,8 @@ Create a maker ask object ready to be signed #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----------------- | :------------------------------------------------------------ | | `CreateMakerInput` | [`CreateMakerInput`](../interfaces/types.CreateMakerInput.md) | #### Returns @@ -193,7 +192,7 @@ Create a maker ask object ready to be signed the maker object, isTransferManagerApproved, and isTransferManagerApproved -___ +--- ### createMakerBid @@ -203,8 +202,8 @@ Create a maker bid object ready to be signed #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----------------- | :------------------------------------------------------------ | | `CreateMakerInput` | [`CreateMakerInput`](../interfaces/types.CreateMakerInput.md) | #### Returns @@ -213,7 +212,7 @@ Create a maker bid object ready to be signed the maker object, isCurrencyApproved, and isBalanceSufficient -___ +--- ### createMakerCollectionOffer @@ -227,9 +226,9 @@ this.createMakerBid #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `orderInputs` | [`CreateMakerCollectionOfferInput`](../modules/types.md#createmakercollectionofferinput) | Order data | +| Name | Type | Description | +| :------------ | :--------------------------------------------------------------------------------------- | :---------- | +| `orderInputs` | [`CreateMakerCollectionOfferInput`](../modules/types.md#createmakercollectionofferinput) | Order data | #### Returns @@ -237,7 +236,7 @@ this.createMakerBid CreateMakerBidOutput -___ +--- ### createMakerCollectionOfferWithProof @@ -251,9 +250,9 @@ this.createMakerBid #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `orderInputs` | [`CreateMakerCollectionOfferWithProofInput`](../modules/types.md#createmakercollectionofferwithproofinput) | Order data | +| Name | Type | Description | +| :------------ | :--------------------------------------------------------------------------------------------------------- | :---------- | +| `orderInputs` | [`CreateMakerCollectionOfferWithProofInput`](../modules/types.md#createmakercollectionofferwithproofinput) | Order data | #### Returns @@ -261,7 +260,7 @@ this.createMakerBid CreateMakerBidOutput -___ +--- ### createTaker @@ -271,11 +270,11 @@ Create a taker ask ready to be executed against a maker bid #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | Maker order that will be used as counterparty for the taker | -| `recipient` | `string` | `constants.AddressZero` | Recipient address of the taker (if none, it will use the sender) | -| `additionalParameters` | `any`[] | `[]` | Additional parameters used to support complex orders | +| Name | Type | Default value | Description | +| :--------------------- | :-------------------------------------- | :------------ | :--------------------------------------------------------------- | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | Maker order that will be used as counterparty for the taker | +| `recipient` | `string` | `ZeroAddress` | Recipient address of the taker (if none, it will use the sender) | +| `additionalParameters` | `any`[] | `[]` | Additional parameters used to support complex orders | #### Returns @@ -283,7 +282,7 @@ Create a taker ask ready to be executed against a maker bid Taker object -___ +--- ### createTakerCollectionOffer @@ -293,16 +292,16 @@ Create a taker ask order for collection order. **`See`** - - this.createTaker - - this.createMakerCollectionOffer +- this.createTaker +- this.createMakerCollectionOffer #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | -| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | -| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | +| Name | Type | Description | +| :----------- | :-------------------------------------- | :--------------------------------------------------------------- | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | +| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | +| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | #### Returns @@ -310,7 +309,7 @@ Create a taker ask order for collection order. Taker object -___ +--- ### createTakerCollectionOfferWithProof @@ -320,17 +319,17 @@ Create a taker ask to fulfill a collection order (maker bid) created with a whit **`See`** - - this.createTaker - - this.createMakerCollectionOfferWithMerkleTree +- this.createTaker +- this.createMakerCollectionOfferWithMerkleTree #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | -| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | -| `itemIds` | `BigNumberish`[] | List of token ids used during the maker creation | -| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | +| Name | Type | Description | +| :----------- | :-------------------------------------- | :--------------------------------------------------------------- | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | +| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | +| `itemIds` | `BigNumberish`[] | List of token ids used during the maker creation | +| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | #### Returns @@ -338,7 +337,7 @@ Create a taker ask to fulfill a collection order (maker bid) created with a whit Taker object -___ +--- ### executeMultipleOrders @@ -348,12 +347,12 @@ Execute several orders #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `orders` | { `maker`: [`Maker`](../interfaces/types.Maker.md) ; `merkleTree?`: [`MerkleTree`](../interfaces/types.MerkleTree.md) ; `signature`: `string` ; `taker`: [`Taker`](../interfaces/types.Taker.md) }[] | `undefined` | List of orders data | -| `isAtomic` | `boolean` | `undefined` | Should the transaction revert or not if a trade fails | -| `affiliate` | `string` | `constants.AddressZero` | Affiliate address | -| `overrides?` | `Overrides` | `undefined` | Call overrides | +| Name | Type | Default value | Description | +| :----------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :---------------------------------------------------- | +| `orders` | { `maker`: [`Maker`](../interfaces/types.Maker.md) ; `merkleTree?`: [`MerkleTree`](../interfaces/types.MerkleTree.md) ; `signature`: `string` ; `taker`: [`Taker`](../interfaces/types.Taker.md) }[] | `undefined` | List of orders data | +| `isAtomic` | `boolean` | `undefined` | Should the transaction revert or not if a trade fails | +| `affiliate` | `string` | `ZeroAddress` | Affiliate address | +| `overrides?` | `Overrides` | `undefined` | Call overrides | #### Returns @@ -361,13 +360,13 @@ Execute several orders ContractMethods -| Name | Type | -| :------ | :------ | -| `call` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`ContractTransaction`\> | -| `callStatic` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`void`\> | -| `estimateGas` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`BigNumber`\> | +| Name | Type | +| :------------ | :-------------------------------------------------------------------------------- | +| `call` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`ContractTransaction`\> | +| `callStatic` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`void`\> | +| `estimateGas` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`BigNumber`\> | -___ +--- ### executeOrder @@ -377,14 +376,14 @@ Execute a trade #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | - | -| `taker` | [`Taker`](../interfaces/types.Taker.md) | `undefined` | Taker order | -| `signature` | `string` | `undefined` | Signature of the maker order | +| Name | Type | Default value | Description | +| :----------- | :------------------------------------------------ | :------------------ | :---------------------------------------------- | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | - | +| `taker` | [`Taker`](../interfaces/types.Taker.md) | `undefined` | Taker order | +| `signature` | `string` | `undefined` | Signature of the maker order | | `merkleTree` | [`MerkleTree`](../interfaces/types.MerkleTree.md) | `defaultMerkleTree` | If the maker has been signed with a merkle tree | -| `affiliate` | `string` | `constants.AddressZero` | Affiliate address if applicable | -| `overrides?` | `Overrides` | `undefined` | - | +| `affiliate` | `string` | `ZeroAddress` | Affiliate address if applicable | +| `overrides?` | `Overrides` | `undefined` | - | #### Returns @@ -392,7 +391,7 @@ Execute a trade ContractMethods -___ +--- ### getSigner @@ -406,7 +405,7 @@ Return the signer it it's set, throw an exception otherwise Signer -___ +--- ### getTypedDataDomain @@ -420,7 +419,7 @@ Retrieve EIP-712 domain TypedDataDomain -___ +--- ### grantTransferManagerApproval @@ -434,10 +433,10 @@ Exchange address #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `operators` | `string`[] | List of operators (default to the exchange address) | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :----------- | :---------- | :-------------------------------------------------- | +| `operators` | `string`[] | List of operators (default to the exchange address) | +| `overrides?` | `Overrides` | - | #### Returns @@ -445,7 +444,7 @@ Exchange address ContractMethods -___ +--- ### isTimestampValid @@ -455,8 +454,8 @@ Validate a timestamp format (seconds) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :---------- | :------------- | | `timestamp` | `BigNumberish` | #### Returns @@ -465,7 +464,7 @@ Validate a timestamp format (seconds) boolean -___ +--- ### isTransferManagerApproved @@ -475,10 +474,10 @@ Check whether or not an operator has been approved by the user #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `operator` | `string` | Operator address (default to the exchange address) | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :----------- | :---------- | :------------------------------------------------- | +| `operator` | `string` | Operator address (default to the exchange address) | +| `overrides?` | `Overrides` | - | #### Returns @@ -486,7 +485,7 @@ Check whether or not an operator has been approved by the user true if the operator is approved, false otherwise -___ +--- ### revokeTransferManagerApproval @@ -500,10 +499,10 @@ Exchange address #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `operators` | `string`[] | List of operators | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :----------- | :---------- | :---------------- | +| `operators` | `string`[] | List of operators | +| `overrides?` | `Overrides` | - | #### Returns @@ -511,7 +510,7 @@ Exchange address ContractMethods -___ +--- ### signMakerOrder @@ -521,8 +520,8 @@ Sign a maker order using the signer provided in the constructor #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :------ | :-------------------------------------- | :----------------------------- | | `maker` | [`Maker`](../interfaces/types.Maker.md) | Order to be signed by the user | #### Returns @@ -531,7 +530,7 @@ Sign a maker order using the signer provided in the constructor Signature -___ +--- ### signMultipleMakerOrders @@ -542,8 +541,8 @@ Sign multiple maker orders with a single signature #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :------------ | :---------------------------------------- | :-------------------- | | `makerOrders` | [`Maker`](../interfaces/types.Maker.md)[] | Array of maker orders | #### Returns @@ -552,7 +551,7 @@ Sign multiple maker orders with a single signature Signature, proofs, and Merkletree object -___ +--- ### strategyInfo @@ -562,10 +561,10 @@ Retrieve strategy info #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :----------------------------------------------- | :------------------------ | | `strategyId` | [`StrategyType`](../enums/types.StrategyType.md) | use the enum StrategyType | -| `overrides?` | `Overrides` | - | +| `overrides?` | `Overrides` | - | #### Returns @@ -573,7 +572,7 @@ Retrieve strategy info StrategyInfo -___ +--- ### transferItemsAcrossCollection @@ -583,11 +582,11 @@ Transfer a list of items across different collections #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `to` | `string` | Recipient address | +| Name | Type | Description | +| :---------------- | :---------------------------------------------------------------- | :--------------------------------------------------------------------------- | +| `to` | `string` | Recipient address | | `collectionItems` | [`BatchTransferItem`](../interfaces/types.BatchTransferItem.md)[] | Each object in the array represent a list of items for a specific collection | -| `overrides?` | `Overrides` | - | +| `overrides?` | `Overrides` | - | #### Returns @@ -595,7 +594,7 @@ Transfer a list of items across different collections ContractMethods -___ +--- ### verifyMakerOrders @@ -605,12 +604,12 @@ Verify if a set of orders can be executed (i.e are valid) #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `makerOrders` | [`Maker`](../interfaces/types.Maker.md)[] | List of maker orders | -| `signatures` | `string`[] | List of signatures | +| Name | Type | Description | +| :------------- | :-------------------------------------------------- | :------------------------------ | +| `makerOrders` | [`Maker`](../interfaces/types.Maker.md)[] | List of maker orders | +| `signatures` | `string`[] | List of signatures | | `merkleTrees?` | [`MerkleTree`](../interfaces/types.MerkleTree.md)[] | List of merkle trees (optional) | -| `overrides?` | `Overrides` | - | +| `overrides?` | `Overrides` | - | #### Returns diff --git a/guides/collectionOrder.md b/guides/collectionOrder.md index 07a4479..d4eadd8 100644 --- a/guides/collectionOrder.md +++ b/guides/collectionOrder.md @@ -18,7 +18,7 @@ The main steps are: Here is an example: ```ts -import { ethers } from "ethers"; +import { parseEther } from "ethers"; import { LooksRare, ChainId, CollectionType, StrategyType } from "@looksrare/sdk-v2"; const lr = new LooksRare(ChainId.MAINNET, provider, signer); @@ -29,7 +29,7 @@ const { maker, isCurrencyApproved, isBalanceSufficient } = await lr.createMakerC subsetNonce: 0, // keep 0 if you don't know what it is used for orderNonce: 0, // You need to retrieve this value from the API endTime: Math.floor(Date.now() / 1000) + 86400, // If you use a timestamp in ms, the function will revert - price: ethers.utils.parseEther("1"), // Be careful to use a price in wei, this example is for 1 ETH + price: parseEther("1"), // Be careful to use a price in wei, this example is for 1 ETH amounts: [1], // Use it for listing multiple ERC-1155 (Optional, Default to [1]) startTime: Math.floor(Date.now() / 1000), // Use it to create an order that will be valid in the future (Optional, Default to now) }); diff --git a/guides/createMakerAsk.md b/guides/createMakerAsk.md index 7911af2..caa62f7 100644 --- a/guides/createMakerAsk.md +++ b/guides/createMakerAsk.md @@ -16,7 +16,7 @@ The main steps are: Here is an example: ```ts -import { ethers } from "ethers"; +import { parseEther } from "ethers"; import { LooksRare, ChainId, CollectionType, StrategyType } from "@looksrare/sdk-v2"; const lr = new LooksRare(ChainId.MAINNET, provider, signer); @@ -28,7 +28,7 @@ const { maker, isCollectionApproved, isTransferManagerApproved } = await lr.crea subsetNonce: 0, // keep 0 if you don't know what it is used for orderNonce: 0, // You need to retrieve this value from the API endTime: Math.floor(Date.now() / 1000) + 86400, // If you use a timestamp in ms, the function will revert - price: ethers.utils.parseEther("1"), // Be careful to use a price in wei, this example is for 1 ETH + price: parseEther("1"), // Be careful to use a price in wei, this example is for 1 ETH itemIds: [0], // Token id of the NFT(s) you want to sell, add several ids to create a bundle amounts: [1], // Use it for listing multiple ERC-1155 (Optional, Default to [1]) startTime: Math.floor(Date.now() / 1000), // Use it to create an order that will be valid in the future (Optional, Default to now) diff --git a/guides/createMakerBid.md b/guides/createMakerBid.md index 6568143..42a82a7 100644 --- a/guides/createMakerBid.md +++ b/guides/createMakerBid.md @@ -6,7 +6,7 @@ The code snippet below is an example of how to create a maker bid using the `@lo The main steps are: -1. Initialize a LooksRare class instance by providing the chain id, [RPC provider](https://docs.ethers.io/v5/api/providers/) and a [signer](https://docs.ethers.io/v5/api/signer/). +1. Initialize a LooksRare class instance by providing the chain id, [JSON-RPC provider](https://docs.ethers.org/v6/api/providers/jsonrpc/) and a [signer](https://docs.ethers.org/v6/api/providers/#Signer). 2. Use the `createMakerBid` method to create a maker bid with the parameters of your order. 3. Check and grant necessary approvals for transferring assets. 4. Sign the maker bid order with `signMakerOrder` method. @@ -28,7 +28,7 @@ const { maker, isCurrencyApproved, isBalanceSufficient } = await lr.createMakerB subsetNonce: 0, // keep 0 if you don't know what it is used for orderNonce: 0, // You need to retrieve this value from the API endTime: Math.floor(Date.now() / 1000) + 86400, // If you use a timestamp in ms, the function will revert - price: ethers.utils.parseEther("1"), // Be careful to use a price in wei, this example is for 1 ETH + price: parseEther("1"), // Be careful to use a price in wei, this example is for 1 ETH itemIds: [0], // Token id of the NFT you want to buy amounts: [1], // Use it for listing several ERC-1155 (Optional, Default to [1]) startTime: Math.floor(Date.now() / 1000), // Use it to create an order that will be valid in the future (Optional, Default to now) diff --git a/package.json b/package.json index 40ca0f8..c9c1ec8 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "*.{js,jsx,ts,tsx,json,yaml,yml}": "yarn format:write" }, "peerDependencies": { - "ethers": "^5.6.8" + "ethers": "^6.6.2" }, "devDependencies": { "@commitlint/cli": "^17.0.2", @@ -69,7 +69,7 @@ "eslint-config-prettier": "^8.7.0", "eslint-plugin-prettier": "^4.2.1", "ethereum-waffle": "^4.0.10", - "ethers": "^5.6.8", + "ethers": "^6.6.2", "hardhat": "^2.13.0", "hardhat-abi-exporter": "^2.9.0", "husky": "^8.0.1", @@ -91,7 +91,6 @@ "typescript": "^4.7.3" }, "dependencies": { - "@0xsequence/multicall": "^0.43.20", "merkletreejs": "^0.3.9" } } diff --git a/src/LooksRare.ts b/src/LooksRare.ts index 5068606..541fc12 100644 --- a/src/LooksRare.ts +++ b/src/LooksRare.ts @@ -1,6 +1,12 @@ -import { BigNumber, providers, constants, BigNumberish, ContractTransaction, Overrides, utils } from "ethers"; +import { + BigNumberish, + ContractTransaction, + Overrides, + JsonRpcProvider, + solidityPackedKeccak256, + ZeroAddress, +} from "ethers"; import { TypedDataDomain } from "@ethersproject/abstract-signer"; -import * as multicall from "@0xsequence/multicall"; import { MerkleTree as MerkleTreeJS } from "merkletreejs"; import { keccak256 } from "js-sha3"; import { addressesByNetwork } from "./constants/addresses"; @@ -64,28 +70,27 @@ export class LooksRare { public readonly addresses: Addresses; /** * Ethers signer - * @see {@link https://docs.ethers.io/v5/api/signer/ Ethers signer doc} + * @see {@link https://docs.ethers.org/v6/api/providers/#Signer Ethers signer doc} */ public readonly signer?: Signer; /** - * Ethers multicall provider - * @see {@link https://docs.ethers.io/v5/api/providers/ Ethers providers doc} - * @see {@link https://github.com/0xsequence/sequence.js/tree/master/packages/multicall 0xsequence multicall doc} + * Ethers JsonRPC provider with batch functionality + * @see {@link https://docs.ethers.org/v6/api/providers/jsonrpc/#about-jsonrpcProvider Ethers providers doc} */ - public readonly provider: providers.Provider; + public readonly provider: JsonRpcProvider; /** * LooksRare protocol main class * @param chainId Current app chain id - * @param provider Ethers provider + * @param provider Ethers JsonRpc provider * @param signer Ethers signer * @param override Overrides contract addresses for hardhat setup */ - constructor(chainId: ChainId, provider: providers.Provider, signer?: Signer, override?: Addresses) { + constructor(chainId: ChainId, provider: JsonRpcProvider, signer?: Signer, override?: Addresses) { this.chainId = chainId; this.addresses = override ?? addressesByNetwork[this.chainId]; this.signer = signer; - this.provider = new multicall.providers.MulticallProvider(provider); + this.provider = provider; } /** @@ -105,7 +110,7 @@ export class LooksRare { * @returns boolean */ private isTimestampValid(timestamp: BigNumberish): boolean { - return BigNumber.from(timestamp).toString().length <= 10; + return BigInt(timestamp).toString().length <= 10; } /** @@ -136,7 +141,7 @@ export class LooksRare { price, itemIds, amounts = [1], - currency = constants.AddressZero, + currency = ZeroAddress, startTime = Math.floor(Date.now() / 1000), additionalParameters = [], }: CreateMakerInput): Promise { @@ -241,8 +246,8 @@ export class LooksRare { return { maker: order, - isCurrencyApproved: BigNumber.from(currentAllowance).gte(price), - isBalanceSufficient: BigNumber.from(balance).gte(price), + isCurrencyApproved: BigInt(currentAllowance) >= BigInt(price), + isBalanceSufficient: BigInt(balance) >= BigInt(price), }; } @@ -267,7 +272,7 @@ export class LooksRare { ): Promise { const { itemIds, ...otherInputs } = orderInputs; const leaves = itemIds.map((itemId) => { - const hash = utils.keccak256(utils.solidityPack(["uint256"], [itemId])); + const hash = solidityPackedKeccak256(["uint256"], [itemId]); return Buffer.from(hash.slice(2), "hex"); }); const tree = new MerkleTreeJS(leaves, keccak256, { sortPairs: true }); @@ -288,7 +293,7 @@ export class LooksRare { * @param additionalParameters Additional parameters used to support complex orders * @returns Taker object */ - public createTaker(maker: Maker, recipient: string = constants.AddressZero, additionalParameters: any[] = []): Taker { + public createTaker(maker: Maker, recipient: string = ZeroAddress, additionalParameters: any[] = []): Taker { const order: Taker = { recipient: recipient, additionalParameters: encodeParams(additionalParameters, getTakerParamsTypes(maker.strategyId)), @@ -337,13 +342,13 @@ export class LooksRare { if (maker.strategyId !== StrategyType.collectionWithMerkleTree) { throw new ErrorStrategyType(); } - const index = itemIds.findIndex((id) => BigNumber.from(id).eq(itemId)); + const index = itemIds.findIndex((id) => BigInt(id) === BigInt(itemId)); if (index === -1) { throw new ErrorItemId(); } const leaves = itemIds.map((id) => { - const hash = utils.keccak256(utils.solidityPack(["uint256"], [id])); + const hash = solidityPackedKeccak256(["uint256"], [id]); return Buffer.from(hash.slice(2), "hex"); }); const tree = new MerkleTreeJS(leaves, keccak256, { sortPairs: true }); @@ -390,7 +395,7 @@ export class LooksRare { taker: Taker, signature: string, merkleTree: MerkleTree = defaultMerkleTree, - affiliate: string = constants.AddressZero, + affiliate: string = ZeroAddress, overrides?: Overrides ): ContractMethods { const signer = this.getSigner(); @@ -414,7 +419,7 @@ export class LooksRare { merkleTree?: MerkleTree; }[], isAtomic: boolean, - affiliate: string = constants.AddressZero, + affiliate: string = ZeroAddress, overrides?: Overrides ) { const signer = this.getSigner(); diff --git a/src/__tests__/eip712.test.ts b/src/__tests__/eip712.test.ts index 36b79f0..b2b5c85 100644 --- a/src/__tests__/eip712.test.ts +++ b/src/__tests__/eip712.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { utils } from "ethers"; +import { AbiCoder, parseEther, utils } from "ethers"; import { TypedDataDomain } from "@ethersproject/abstract-signer"; import { setUpContracts, SetupMocks, getSigners, Signers } from "./helpers/setup"; import { computeDigestMaker, getDomainSeparator } from "./helpers/eip712"; @@ -36,10 +36,10 @@ describe("EIP-712", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], - additionalParameters: utils.defaultAbiCoder.encode([], []), + additionalParameters: AbiCoder.defaultAbiCoder().encode([], []), }; }); it("validate domain data", async () => { diff --git a/src/__tests__/helpers/eip712.ts b/src/__tests__/helpers/eip712.ts index d6259c9..04eeed4 100644 --- a/src/__tests__/helpers/eip712.ts +++ b/src/__tests__/helpers/eip712.ts @@ -1,4 +1,4 @@ -import { utils } from "ethers"; +import { AbiCoder, keccak256, solidityPackedKeccak256, toUtf8Bytes } from "ethers"; import { TypedDataDomain } from "@ethersproject/abstract-signer"; import { getMakerHash } from "../../utils/eip712"; import { Maker, SolidityType } from "../../types"; @@ -14,15 +14,13 @@ import { Maker, SolidityType } from "../../types"; export const getDomainSeparator = (domain: TypedDataDomain): string => { const types: SolidityType[] = ["bytes32", "bytes32", "bytes32", "uint256", "address"]; const values = [ - utils.keccak256( - utils.toUtf8Bytes("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)") - ), - utils.keccak256(utils.toUtf8Bytes(domain.name!)), - utils.keccak256(utils.toUtf8Bytes(domain.version!)), + keccak256(toUtf8Bytes("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")), + keccak256(toUtf8Bytes(domain.name!)), + keccak256(toUtf8Bytes(domain.version!)), domain.chainId!, domain.verifyingContract!, ]; - return utils.keccak256(utils.defaultAbiCoder.encode(types, values)); + return keccak256(AbiCoder.defaultAbiCoder().encode(types, values)); }; /** @@ -36,5 +34,5 @@ export const computeDigestMaker = (domain: TypedDataDomain, makerOrder: Maker): const domainSeparator = getDomainSeparator(domain); const hash = getMakerHash(makerOrder); const types: SolidityType[] = ["string", "bytes32", "bytes32"]; - return utils.keccak256(utils.solidityPack(types, ["\x19\x01", domainSeparator, hash])); + return solidityPackedKeccak256(types, ["\x19\x01", domainSeparator, hash]); }; diff --git a/src/__tests__/helpers/setup.ts b/src/__tests__/helpers/setup.ts index af47627..bddff07 100644 --- a/src/__tests__/helpers/setup.ts +++ b/src/__tests__/helpers/setup.ts @@ -1,5 +1,5 @@ /* eslint-disable no-await-in-loop */ -import { Contract, constants, ContractTransaction } from "ethers"; +import { Contract, ContractTransaction, ZeroAddress, parseEther } from "ethers"; import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import { ethers } from "hardhat"; @@ -83,7 +83,7 @@ export const setUpContracts = async (): Promise => { tx = await looksRareProtocol.updateCreatorFeeManager(feeManager.address); await tx.wait(); - tx = await looksRareProtocol.updateCurrencyStatus(constants.AddressZero, true); + tx = await looksRareProtocol.updateCurrencyStatus(ZeroAddress, true); await tx.wait(); tx = await looksRareProtocol.updateCurrencyStatus(weth.address, true); await tx.wait(); @@ -114,11 +114,11 @@ export const setUpContracts = async (): Promise => { // Setup balances const wethUser1 = new ethers.Contract(weth.address, weth.interface, signers.user1); - tx = await wethUser1.deposit({ value: ethers.utils.parseEther("10") }); + tx = await wethUser1.deposit({ value: parseEther("10") }); await tx.wait(); const wethUser2 = new ethers.Contract(weth.address, weth.interface, signers.user2); - tx = await wethUser2.deposit({ value: ethers.utils.parseEther("10") }); + tx = await wethUser2.deposit({ value: parseEther("10") }); await tx.wait(); for (let i = 0; i < NB_NFT_PER_USER; i++) { @@ -142,12 +142,12 @@ export const setUpContracts = async (): Promise => { }, addresses: { EXCHANGE_V2: looksRareProtocol.address, - LOOKS: constants.AddressZero, + LOOKS: ZeroAddress, TRANSFER_MANAGER_V2: transferManager.address, WETH: weth.address, ORDER_VALIDATOR_V2: orderValidator.address, - REVERSE_RECORDS: constants.AddressZero, - LOOKS_LP_V3: constants.AddressZero, + REVERSE_RECORDS: ZeroAddress, + LOOKS_LP_V3: ZeroAddress, }, }; }; diff --git a/src/__tests__/looksrare/createMakerAsk.test.ts b/src/__tests__/looksrare/createMakerAsk.test.ts index 419c932..9327f9e 100644 --- a/src/__tests__/looksrare/createMakerAsk.test.ts +++ b/src/__tests__/looksrare/createMakerAsk.test.ts @@ -26,7 +26,7 @@ describe("Create maker ask", () => { subsetNonce: 0, orderNonce: 0, endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [1], }; }); @@ -77,7 +77,7 @@ describe("Create maker ask", () => { collectionType: baseMakerAskInput.collectionType, orderNonce: baseMakerAskInput.orderNonce, collection: baseMakerAskInput.collection, - currency: constants.AddressZero, + currency: ZeroAddress, signer: signers.user1.address, startTime: output.maker.startTime, // Can't really test the Date.now( executed inside the function) endTime: baseMakerAskInput.endTime, diff --git a/src/__tests__/looksrare/createMakerBid.test.ts b/src/__tests__/looksrare/createMakerBid.test.ts index 0ab0df1..63b5924 100644 --- a/src/__tests__/looksrare/createMakerBid.test.ts +++ b/src/__tests__/looksrare/createMakerBid.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { constants, utils } from "ethers"; +import { MaxUint256, parseEther } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; @@ -26,7 +26,7 @@ describe("Create maker bid", () => { subsetNonce: 0, orderNonce: 0, endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [1], }; }); @@ -51,7 +51,7 @@ describe("Create maker bid", () => { signers.user1.address, mocks.addresses.EXCHANGE_V2 ); - expect(valueApproved.eq(constants.MaxUint256)).to.be.true; + expect(valueApproved.eq(MaxUint256)).to.be.true; }); it("approval checks are true if approval were made", async () => { @@ -64,7 +64,7 @@ describe("Create maker bid", () => { it("balance checks are false if balance is not sufficient", async () => { const { isBalanceSufficient } = await lrUser1.createMakerBid({ ...baseMakerInput, - price: utils.parseEther("100000"), + price: parseEther("100000"), }); expect(isBalanceSufficient).to.be.false; }); @@ -78,7 +78,7 @@ describe("Create maker bid", () => { const output = await lrUser1.createMakerBid(baseMakerInput); const makerOrder: Maker = { quoteType: QuoteType.Bid, - globalNonce: constants.Zero, + globalNonce: 0, subsetNonce: baseMakerInput.subsetNonce, strategyId: baseMakerInput.strategyId, collectionType: baseMakerInput.collectionType, @@ -108,7 +108,7 @@ describe("Create maker bid", () => { const output = await lrUser1.createMakerBid(input); const makerOrder: Maker = { quoteType: QuoteType.Bid, - globalNonce: constants.Zero, + globalNonce: 0, subsetNonce: input.subsetNonce, strategyId: input.strategyId, collectionType: input.collectionType, diff --git a/src/__tests__/looksrare/createTaker.test.ts b/src/__tests__/looksrare/createTaker.test.ts index 390f23d..0df251e 100644 --- a/src/__tests__/looksrare/createTaker.test.ts +++ b/src/__tests__/looksrare/createTaker.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { BigNumber, utils } from "ethers"; +import { AbiCoder, parseEther } from "ethers"; import { ethers } from "hardhat"; import { getTakerParamsTypes } from "../../utils/encodeOrderParams"; import { LooksRare } from "../../LooksRare"; @@ -26,7 +26,7 @@ describe("Create takers", () => { orderNonce: 0, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [1], }; }); @@ -44,7 +44,7 @@ describe("Create takers", () => { const { maker } = await lrUser1.createMakerAsk(baseMakerInput); const taker = lrUser1.createTaker(maker); - expect(taker.recipient).to.be.equal(ethers.constants.AddressZero); + expect(taker.recipient).to.be.equal(ethers.ZeroAddress); expect(taker.additionalParameters).to.be.equal("0x"); }); }); @@ -56,10 +56,13 @@ describe("Create takers", () => { strategyId: StrategyType.collection, }); const taker = lrUser1.createTakerCollectionOffer(maker, 1, signers.user2.address); - const [itemId] = utils.defaultAbiCoder.decode(getTakerParamsTypes(maker.strategyId), taker.additionalParameters); + const [itemId] = AbiCoder.defaultAbiCoder().decode( + getTakerParamsTypes(maker.strategyId), + taker.additionalParameters + ); expect(taker.recipient).to.be.equal(signers.user2.address); - expect(BigNumber.from(itemId).toNumber()).to.be.equal(1); + expect(Number(BigInt(itemId))).to.be.equal(1); }); it("throw when quote type is wrong", async () => { @@ -87,9 +90,12 @@ describe("Create takers", () => { }); const taker = lrUser1.createTakerCollectionOfferWithProof(maker, 1, itemIds, signers.user2.address); - const [itemId] = utils.defaultAbiCoder.decode(getTakerParamsTypes(maker.strategyId), taker.additionalParameters); + const [itemId] = AbiCoder.defaultAbiCoder().decode( + getTakerParamsTypes(maker.strategyId), + taker.additionalParameters + ); expect(taker.recipient).to.be.equal(signers.user2.address); - expect(BigNumber.from(itemId).toNumber()).to.be.equal(1); + expect(Number(BigInt(itemId))).to.be.equal(1); }); it("throw when quote type is wrong", async () => { diff --git a/src/__tests__/looksrare/executeCollectionOrder.test.ts b/src/__tests__/looksrare/executeCollectionOrder.test.ts index 3a8e832..4f12c76 100644 --- a/src/__tests__/looksrare/executeCollectionOrder.test.ts +++ b/src/__tests__/looksrare/executeCollectionOrder.test.ts @@ -26,7 +26,7 @@ describe("execute collection order", () => { orderNonce: 0, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), }; let tx = await lrUser1.grantTransferManagerApproval().call(); diff --git a/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts b/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts index bd6e3c3..f1f3f3a 100644 --- a/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts +++ b/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts @@ -27,7 +27,7 @@ describe("execute collection order with proof", () => { orderNonce: 0, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), }; let tx = await lrUser1.grantTransferManagerApproval().call(); diff --git a/src/__tests__/looksrare/executeMultipleTakerBids.test.ts b/src/__tests__/looksrare/executeMultipleTakerBids.test.ts index 8ae429c..80888f3 100644 --- a/src/__tests__/looksrare/executeMultipleTakerBids.test.ts +++ b/src/__tests__/looksrare/executeMultipleTakerBids.test.ts @@ -28,7 +28,7 @@ describe("execute multiple taker bids", () => { orderNonce: 0, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [0], }; diff --git a/src/__tests__/looksrare/executeTakerAsk.test.ts b/src/__tests__/looksrare/executeTakerAsk.test.ts index b3f0956..9df0d7f 100644 --- a/src/__tests__/looksrare/executeTakerAsk.test.ts +++ b/src/__tests__/looksrare/executeTakerAsk.test.ts @@ -27,7 +27,7 @@ describe("execute taker ask", () => { orderNonce: 0, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [1], }; diff --git a/src/__tests__/looksrare/executeTakerBid.test.ts b/src/__tests__/looksrare/executeTakerBid.test.ts index c6e2383..70d38af 100644 --- a/src/__tests__/looksrare/executeTakerBid.test.ts +++ b/src/__tests__/looksrare/executeTakerBid.test.ts @@ -26,7 +26,7 @@ describe("execute taker bid", () => { orderNonce: 0, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [1], }; diff --git a/src/__tests__/looksrare/orderValidator.test.ts b/src/__tests__/looksrare/orderValidator.test.ts index d4640cc..27d1445 100644 --- a/src/__tests__/looksrare/orderValidator.test.ts +++ b/src/__tests__/looksrare/orderValidator.test.ts @@ -26,7 +26,7 @@ describe("Order validation", () => { orderNonce: 0, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [1], }; @@ -37,7 +37,7 @@ describe("Order validation", () => { subsetNonce: 0, orderNonce: 0, endTime: Math.floor(Date.now() / 1000) + 3600, - price: utils.parseEther("1"), + price: parseEther("1"), itemIds: [1], }; diff --git a/src/__tests__/looksrare/signMakerOrders.test.ts b/src/__tests__/looksrare/signMakerOrders.test.ts index 63c2eec..63fb90c 100644 --- a/src/__tests__/looksrare/signMakerOrders.test.ts +++ b/src/__tests__/looksrare/signMakerOrders.test.ts @@ -1,7 +1,6 @@ import { expect } from "chai"; -import { utils } from "ethers"; +import { AbiCoder, parseEther, verifyTypedData, TypedDataDomain } from "ethers"; import { ethers } from "hardhat"; -import { TypedDataDomain } from "@ethersproject/abstract-signer"; import { LooksRare } from "../../LooksRare"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { contractName, version } from "../../constants/eip712"; @@ -48,7 +47,7 @@ describe("Sign maker orders", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], additionalParameters: encodeParams([], getMakerParamsTypes(StrategyType.standard)), @@ -56,7 +55,7 @@ describe("Sign maker orders", () => { const signature = await lrUser1.signMakerOrder(makerOrder); - expect(utils.verifyTypedData(domain, makerTypes, makerOrder, signature)).to.equal(signers.user1.address); + expect(verifyTypedData(domain, makerTypes, makerOrder, signature)).to.equal(signers.user1.address); await expect(verifier.verifySignature(makerOrder, signature)).to.eventually.be.fulfilled; await expect(verifier.verifySignature(makerOrder, faultySignature)).to.eventually.be.rejectedWith( "call revert exception" @@ -77,7 +76,7 @@ describe("Sign maker orders", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], additionalParameters: encodeParams([], getTakerParamsTypes(StrategyType.standard)), @@ -85,7 +84,7 @@ describe("Sign maker orders", () => { const signature = await lrUser1.signMakerOrder(makerOrder); - expect(utils.verifyTypedData(domain, makerTypes, makerOrder, signature)).to.equal(signers.user1.address); + expect(verifyTypedData(domain, makerTypes, makerOrder, signature)).to.equal(signers.user1.address); await expect(verifier.verifySignature(makerOrder, signature)).to.eventually.be.fulfilled; await expect(verifier.verifySignature(makerOrder, faultySignature)).to.eventually.be.rejectedWith( "call revert exception" @@ -109,10 +108,10 @@ describe("Sign maker orders", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], - additionalParameters: utils.defaultAbiCoder.encode([], []), + additionalParameters: AbiCoder.defaultAbiCoder().encode([], []), }, { quoteType: QuoteType.Bid, @@ -126,10 +125,10 @@ describe("Sign maker orders", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], - additionalParameters: utils.defaultAbiCoder.encode([], []), + additionalParameters: AbiCoder.defaultAbiCoder().encode([], []), }, { quoteType: QuoteType.Bid, @@ -143,17 +142,17 @@ describe("Sign maker orders", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], - additionalParameters: utils.defaultAbiCoder.encode([], []), + additionalParameters: AbiCoder.defaultAbiCoder().encode([], []), }, ]; const { signature, merkleTreeProofs, tree } = await lrUser1.signMultipleMakerOrders(makerOrders); const signerAddress = signers.user1.address; - expect(utils.verifyTypedData(domain, tree.types, tree.getDataToSign(), signature)).to.equal(signerAddress); + expect(verifyTypedData(domain, tree.types, tree.getDataToSign(), signature)).to.equal(signerAddress); merkleTreeProofs.forEach(async (merkleTreeProof) => { await expect(verifier.verifyMerkleTree(merkleTreeProof, signature, signerAddress)).to.eventually.be.fulfilled; @@ -177,10 +176,10 @@ describe("Sign maker orders", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], - additionalParameters: utils.defaultAbiCoder.encode([], []), + additionalParameters: AbiCoder.defaultAbiCoder().encode([], []), })); await expect(lrUser1.signMultipleMakerOrders(makerOrders)).to.eventually.be.fulfilled; @@ -200,10 +199,10 @@ describe("Sign maker orders", () => { signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), endTime: Math.floor(Date.now() / 1000 + 3600), - price: utils.parseEther("1").toString(), + price: parseEther("1").toString(), itemIds: [1], amounts: [1], - additionalParameters: utils.defaultAbiCoder.encode([], []), + additionalParameters: AbiCoder.defaultAbiCoder().encode([], []), })); await expect(lrUser1.signMultipleMakerOrders(makerOrders)).to.eventually.be.rejectedWith(ErrorMerkleTreeDepth); diff --git a/src/constants/index.ts b/src/constants/index.ts index 562a69c..ff9d563 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -9,7 +9,7 @@ export const MAX_ORDERS_PER_TREE = 1024; /** * Default merkle tree value used when the merkle tree can be omitted. */ -export const defaultMerkleTree = { root: constants.HashZero, proof: [] }; +export const defaultMerkleTree = { root: ZeroHash, proof: [] }; export { addressesByNetwork } from "./addresses"; export { chainInfo } from "./chains"; diff --git a/src/types.ts b/src/types.ts index 39d084d..184cd1b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { ethers, BigNumberish, BytesLike, ContractTransaction, BigNumber, Overrides } from "ethers"; +import { ethers, BigNumberish, BytesLike, ContractTransaction, Overrides } from "ethers"; import { TypedDataSigner, TypedDataField } from "@ethersproject/abstract-signer"; import { Eip712MakerMerkleTree } from "./utils/Eip712MakerMerkleTree"; @@ -92,7 +92,7 @@ export type Signer = ethers.Signer & TypedDataSigner; /** Return type for any on chain call */ export interface ContractMethods { call: (additionalOverrides?: Overrides) => Promise; - estimateGas: (additionalOverrides?: Overrides) => Promise; + estimateGas: (additionalOverrides?: Overrides) => Promise; callStatic: (additionalOverrides?: Overrides) => Promise; } diff --git a/src/utils/Eip712MakerMerkleTree.ts b/src/utils/Eip712MakerMerkleTree.ts index f960846..edd5527 100644 --- a/src/utils/Eip712MakerMerkleTree.ts +++ b/src/utils/Eip712MakerMerkleTree.ts @@ -1,4 +1,4 @@ -import { constants } from "ethers"; +import { ZeroAddress } from "ethers"; import { Eip712MerkleTree } from "./Eip712MerkleTree"; import { getBatchOrderTypes } from "./eip712"; import { Maker, QuoteType, StrategyType, CollectionType } from "../types"; @@ -10,9 +10,9 @@ const defaultMaker: Maker = { orderNonce: 0, strategyId: StrategyType.standard, collectionType: CollectionType.ERC721, - collection: constants.AddressZero, - currency: constants.AddressZero, - signer: constants.AddressZero, + collection: ZeroAddress, + currency: ZeroAddress, + signer: ZeroAddress, startTime: 0, endTime: 0, price: 0, diff --git a/src/utils/calls/exchange.ts b/src/utils/calls/exchange.ts index 0c17d1f..d32c118 100644 --- a/src/utils/calls/exchange.ts +++ b/src/utils/calls/exchange.ts @@ -1,4 +1,4 @@ -import { Contract, PayableOverrides, constants, BigNumber } from "ethers"; +import { Contract, PayableOverrides, BigNumber, ZeroAddress } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abiLooksRareProtocol from "../../abis/LooksRareProtocol.json"; import { Maker, MerkleTree, Taker, Signer, ContractMethods } from "../../types"; @@ -15,7 +15,7 @@ export const executeTakerBid = ( ): ContractMethods => { const overridesWithValue: PayableOverrides = { ...overrides, - ...(maker.currency === constants.AddressZero && { value: maker.price }), + ...(maker.currency === ZeroAddress && { value: maker.price }), }; const contract = new Contract(address, abiLooksRareProtocol, signer) as LooksRareProtocol; return { @@ -79,7 +79,7 @@ export const executeMultipleTakerBids = ( overrides?: PayableOverrides ) => { const value = maker.reduce( - (acc, order) => (order.currency === constants.AddressZero ? acc.add(order.price) : acc), + (acc, order) => (order.currency === ZeroAddress ? acc.add(order.price) : acc), BigNumber.from(0) ); const overridesWithValue: PayableOverrides = { diff --git a/src/utils/calls/strategies.ts b/src/utils/calls/strategies.ts index d3db027..11a0d34 100644 --- a/src/utils/calls/strategies.ts +++ b/src/utils/calls/strategies.ts @@ -1,10 +1,10 @@ -import { Contract, CallOverrides, providers } from "ethers"; +import { Contract, CallOverrides, Provider } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abi from "../../abis/LooksRareProtocol.json"; import { Signer, StrategyType, StrategyInfo } from "../../types"; export const strategyInfo = async ( - signerOrProvider: providers.Provider | Signer, + signerOrProvider: Provider | Signer, address: string, strategyId: StrategyType, overrides?: CallOverrides diff --git a/src/utils/eip712.ts b/src/utils/eip712.ts index 655ea54..0f7e387 100644 --- a/src/utils/eip712.ts +++ b/src/utils/eip712.ts @@ -1,4 +1,4 @@ -import { utils } from "ethers"; +import { AbiCoder, keccak256, solidityPackedKeccak256 } from "ethers"; import { EIP712TypedData, Maker } from "../types"; // EIP 712 (Typed structured data hashing and signing) related data @@ -89,9 +89,9 @@ export const getMakerHash = (maker: Maker): string => { maker.startTime, maker.endTime, maker.price, - utils.keccak256(utils.solidityPack(["uint256[]"], [maker.itemIds])), - utils.keccak256(utils.solidityPack(["uint256[]"], [maker.amounts])), - utils.keccak256(maker.additionalParameters), + solidityPackedKeccak256(["uint256[]"], [maker.itemIds]), + solidityPackedKeccak256(["uint256[]"], [maker.amounts]), + keccak256(maker.additionalParameters), ]; - return utils.keccak256(utils.defaultAbiCoder.encode(hashingMakerTypes, values)); + return keccak256(AbiCoder.defaultAbiCoder().encode(hashingMakerTypes, values)); }; diff --git a/src/utils/encodeOrderParams.ts b/src/utils/encodeOrderParams.ts index 44e12c6..1a8a2a2 100644 --- a/src/utils/encodeOrderParams.ts +++ b/src/utils/encodeOrderParams.ts @@ -1,4 +1,4 @@ -import { BytesLike, utils } from "ethers"; +import { AbiCoder, BytesLike } from "ethers"; import { SolidityType, StrategyType } from "../types"; /** @@ -42,5 +42,5 @@ export const getTakerParamsTypes = (strategy: StrategyType): SolidityType[] => { * @returns encoded params */ export const encodeParams = (params: any[], types: SolidityType[]): BytesLike => { - return utils.defaultAbiCoder.encode(types, params); + return AbiCoder.defaultAbiCoder().encode(types, params); }; diff --git a/src/utils/provider.ts b/src/utils/provider.ts new file mode 100644 index 0000000..a40b79d --- /dev/null +++ b/src/utils/provider.ts @@ -0,0 +1,7 @@ +import { FetchRequest, JsonRpcApiProviderOptions, JsonRpcProvider, Networkish } from "ethers"; + +export class BatchProvider extends JsonRpcProvider { + constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions) { + super(url, network, options); + } +} diff --git a/src/utils/signMakerOrders.ts b/src/utils/signMakerOrders.ts index 3aad731..9aecd4e 100644 --- a/src/utils/signMakerOrders.ts +++ b/src/utils/signMakerOrders.ts @@ -1,5 +1,5 @@ import { TypedDataSigner, TypedDataDomain } from "@ethersproject/abstract-signer"; -import { utils } from "ethers"; +import { ethers } from "ethers"; import { Eip712MakerMerkleTree } from "./Eip712MakerMerkleTree"; import { makerTypes } from "./eip712"; import { Maker, MerkleTree, SignMerkleTreeOrdersOutput } from "../types"; @@ -17,7 +17,7 @@ export const signMakerOrder = async ( makerOrder: Maker ): Promise => { const signature = await signer._signTypedData(domain, makerTypes, makerOrder); - return utils.joinSignature(signature); + return ethers.Signature.from(signature).serialized; }; /** @@ -49,5 +49,5 @@ export const signMerkleTreeOrders = async ( }); const signature = await signer._signTypedData(domain, tree.types, tree.getDataToSign()); - return { signature: utils.joinSignature(signature), merkleTreeProofs, tree }; + return { signature: ethers.Signature.from(signature).serialized, merkleTreeProofs, tree }; }; diff --git a/yarn.lock b/yarn.lock index f95b37b..95fc4f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,139 +2,10 @@ # yarn lockfile v1 -"@0xsequence/abi@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/abi/-/abi-0.43.26.tgz#d9ff4639b839e2c5cf19bbac118318ee9bb72e9c" - integrity sha512-libZgp7wA5DSf4QOmTQb5n1V1cvPXG/qxf8KdGoBEklSZtfbC+G2xcbCGQZOl0qg0j5GwX9B0UtaSXe6IObooQ== - -"@0xsequence/api@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/api/-/api-0.43.26.tgz#4a29420bbf57f0f55b3b369cfc74a1e64c5439cd" - integrity sha512-+vOEwO/zHUtFai2qloxO5VK0k9t9MrKnOAQUamKLMupDac20GdUjPnaiVfHZ3X16v8yopf2W7Pn9zSMbg4nGBQ== - -"@0xsequence/auth@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/auth/-/auth-0.43.26.tgz#7d7af92e45da8994c902da61de4901d3dc979f06" - integrity sha512-iiGJQf5pg+uAi2nyYxGMbUs3N295CLwg2MnqJbO71/5S/s3eBhSL+lm2hcJvTqh4wRYEmIYsGj2m7t5RATY9ug== - dependencies: - "@0xsequence/abi" "^0.43.26" - "@0xsequence/api" "^0.43.26" - "@0xsequence/config" "^0.43.26" - "@0xsequence/ethauth" "^0.8.0" - "@0xsequence/indexer" "^0.43.26" - "@0xsequence/metadata" "^0.43.26" - "@0xsequence/network" "^0.43.26" - "@0xsequence/provider" "^0.43.26" - "@0xsequence/utils" "^0.43.26" - "@0xsequence/wallet" "^0.43.26" - -"@0xsequence/config@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/config/-/config-0.43.26.tgz#f984260823e6e9d09c3d48eaadad5afdb280c8a0" - integrity sha512-Iiip9gPFMOngxEalDgF6f2szJ6Xbme3aAgdW5Xwy4xv+aMPmQH1euEF0/2yD4vGpbG/5aeOR5H0H4zrsuU2/8Q== - dependencies: - "@0xsequence/abi" "^0.43.26" - "@0xsequence/multicall" "^0.43.26" - "@0xsequence/network" "^0.43.26" - "@0xsequence/utils" "^0.43.26" - -"@0xsequence/ethauth@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@0xsequence/ethauth/-/ethauth-0.8.1.tgz#9b97a17e74ca9559b79a93a8e39ca77baaccc943" - integrity sha512-P21cxRSS+2mDAqFVAJt0lwQFtbObX+Ewlj8DMyDELp81+QbfHFh6LCyu8dTXNdBx6UbmRFOCSBno5Txd50cJPQ== - dependencies: - js-base64 "^3.7.2" - -"@0xsequence/guard@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/guard/-/guard-0.43.26.tgz#6e827a174ee06de44412d58f59de9c8825243d49" - integrity sha512-C7fRENl+SLQTlrbU3BmxTcG6mB9VApxLLhXscXUEZmWhkGRncEQIPmJaT0RZ2ymchpKGUaKS9w59iyWnejfLzw== - -"@0xsequence/indexer@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/indexer/-/indexer-0.43.26.tgz#dbca9e7d72f12f11993a7967d3b22033288a3c74" - integrity sha512-mK9WoEvsQjLmVPrkFOdnH2pKCPLyZR6RA14pxgEj/sakmwqRWj9dQIjrNwMWak9Q0XJJ4enlKw/w5xg5HVJzHg== - -"@0xsequence/metadata@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/metadata/-/metadata-0.43.26.tgz#3cedd82f512c554f6741d84c2dba50bd3950a5c2" - integrity sha512-WaD2oInmtFSHHCF+BpQBkBuqBwxcLi7N2uRowhAaQj/vxLJYDz1yIOZS+iWqZnkm5l3ZuidTyfmn+HCw4BIxvw== - -"@0xsequence/multicall@^0.43.20", "@0xsequence/multicall@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/multicall/-/multicall-0.43.26.tgz#f04e8e0630a611201439b194a7ff8c0f134f5682" - integrity sha512-N4QX5tI2EkFvQS8PR/kVj/RrE9TUFmhqBOv/c4nmZWeuf2X4GS38x55yicnVZmysEX9N5A0URNGa1t0ynGKjdg== - dependencies: - "@0xsequence/abi" "^0.43.26" - "@0xsequence/network" "^0.43.26" - "@0xsequence/utils" "^0.43.26" - -"@0xsequence/network@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/network/-/network-0.43.26.tgz#2d1b44ab064f33842f68c582367b35870f6ef70e" - integrity sha512-e8DEwK5LV+u1TiTBBGHb7/MnTv33+X/0h3aIroMOmHqLjpeDqnJYEvonLYyFNKMX11sse4bvWVC+4PW3pD0k0g== - dependencies: - "@0xsequence/indexer" "^0.43.26" - "@0xsequence/provider" "^0.43.26" - "@0xsequence/relayer" "^0.43.26" - "@0xsequence/utils" "^0.43.26" - -"@0xsequence/provider@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/provider/-/provider-0.43.26.tgz#0204e190cc5ad446dd44d01e9ced9ec3b011c4f7" - integrity sha512-tpE7BDPNy+4o1KATB1FI25RT9Pj+RdD0wQtpshcrKLuFvWbcdbA/VgD7k0EgZWBnTCMjBc12MZ7pzIrJXxCWHA== - dependencies: - "@0xsequence/abi" "^0.43.26" - "@0xsequence/auth" "^0.43.26" - "@0xsequence/config" "^0.43.26" - "@0xsequence/network" "^0.43.26" - "@0xsequence/relayer" "^0.43.26" - "@0xsequence/transactions" "^0.43.26" - "@0xsequence/utils" "^0.43.26" - "@0xsequence/wallet" "^0.43.26" - eventemitter2 "^6.4.5" - webextension-polyfill "^0.10.0" - -"@0xsequence/relayer@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/relayer/-/relayer-0.43.26.tgz#cd5841f0975ad4fa8398fd67f5d2705acd8c94f8" - integrity sha512-cQ64XokGd7qLsc9tbWShS4AFCo4ikQLb7aitiuPo61GTE8oHaTjckWupBq/cC5zKte0qGVMZFeWI+x6K/yceKA== - dependencies: - "@0xsequence/abi" "^0.43.26" - "@0xsequence/config" "^0.43.26" - "@0xsequence/network" "^0.43.26" - "@0xsequence/transactions" "^0.43.26" - "@0xsequence/utils" "^0.43.26" - -"@0xsequence/transactions@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/transactions/-/transactions-0.43.26.tgz#3039e2436ec535889eb103e7aab526704c215e7c" - integrity sha512-b8bG8Y49YjyjnBKUcJV/H28MrNsnPagVkJgCFdTmQEb2XyHXAMqSDiNrRC3EG98H5yy9PT7wXkiaMI4YXaKgtQ== - dependencies: - "@0xsequence/abi" "^0.43.26" - "@0xsequence/config" "^0.43.26" - "@0xsequence/network" "^0.43.26" - "@0xsequence/utils" "^0.43.26" - -"@0xsequence/utils@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/utils/-/utils-0.43.26.tgz#221d518da77badacaa7934af1b2c00dc26fbc8cb" - integrity sha512-952LB3mQO4qwA7USdl+75vnkuiiYuCFZ61J49T/jib7Oef/qM9JSlYEDBrZBB6DVtXAEH8zdKLjcewCmc+H2rg== - dependencies: - js-base64 "^3.7.2" - -"@0xsequence/wallet@^0.43.26": - version "0.43.26" - resolved "https://registry.yarnpkg.com/@0xsequence/wallet/-/wallet-0.43.26.tgz#520ecafafb54a847b124b9176d67c29ff88f4d89" - integrity sha512-oG/2W0kgtuTosg/5bRxpuooviytd7BgQi3U6x/OyygcKhYpo2CTsLKifU90GANI7aCe71Nj0EDlWZx3UAIrojA== - dependencies: - "@0xsequence/abi" "^0.43.26" - "@0xsequence/config" "^0.43.26" - "@0xsequence/guard" "^0.43.26" - "@0xsequence/network" "^0.43.26" - "@0xsequence/relayer" "^0.43.26" - "@0xsequence/transactions" "^0.43.26" - "@0xsequence/utils" "^0.43.26" +"@adraffy/ens-normalize@1.9.2": + version "1.9.2" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.2.tgz#60111a5d9db45b2e5cbb6231b0bb8d97e8659316" + integrity sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg== "@ampproject/remapping@^2.2.0": version "2.2.1" @@ -1268,6 +1139,11 @@ lodash "^4.17.16" uuid "^7.0.3" +"@noble/hashes@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" + integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== + "@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" @@ -1990,6 +1866,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== +"@types/node@18.15.13": + version "18.15.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -2203,6 +2084,11 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== +aes-js@4.0.0-beta.5: + version "4.0.0-beta.5" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== + agent-base@6, agent-base@^6.0.0, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -3910,7 +3796,7 @@ ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.3, ethereum ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@^5.6.8, ethers@^5.7.1: +ethers@^5.7.1: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -3946,6 +3832,19 @@ ethers@^5.6.8, ethers@^5.7.1: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" +ethers@^6.6.2: + version "6.6.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.6.2.tgz#0b6131b5fa291fec69b7ae379cb6bb2405c505a7" + integrity sha512-vyWfVAj2g7xeZIivOqlbpt7PbS2MzvJkKgsncgn4A/1xZr8Q3BznBmEBRQyPXKCgHmX4PzRQLpnYG7jl/yutMg== + dependencies: + "@adraffy/ens-normalize" "1.9.2" + "@noble/hashes" "1.1.2" + "@noble/secp256k1" "1.7.1" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.5.0" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -3967,11 +3866,6 @@ event-target-shim@^5.0.0: resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== -eventemitter2@^6.4.5: - version "6.4.9" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.9.tgz#41f2750781b4230ed58827bc119d293471ecb125" - integrity sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg== - evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" @@ -5423,11 +5317,6 @@ iterate-value@^1.0.2: es-get-iterator "^1.0.2" iterate-iterator "^1.0.1" -js-base64@^3.7.2: - version "3.7.5" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.5.tgz#21e24cf6b886f76d6f5f165bfcd69cc55b9e3fca" - integrity sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA== - js-sdsl@^4.1.4: version "4.4.0" resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.0.tgz#8b437dbe642daa95760400b602378ed8ffea8430" @@ -8009,6 +7898,11 @@ ts-node@^10.8.1, ts-node@^10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +tslib@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tslib@^1.8.1, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -8385,11 +8279,6 @@ web3-utils@^1.3.4: randombytes "^2.1.0" utf8 "3.0.0" -webextension-polyfill@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz#ccb28101c910ba8cf955f7e6a263e662d744dbb8" - integrity sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -8527,6 +8416,11 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + ws@^7.4.6: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" From b473f22007636173d406b58aaaca665e0effe699 Mon Sep 17 00:00:00 2001 From: perryrare Date: Tue, 11 Jul 2023 22:05:44 -0400 Subject: [PATCH 02/10] chore: Upgrade to typechain ethers-v5 --- hardhat.config.ts | 2 +- package.json | 2 +- src/utils/Eip712MerkleTree.ts | 2 +- yarn.lock | 8 ++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index f6eb483..b9f1e40 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -51,7 +51,7 @@ const config = { }, typechain: { outDir: "src/typechain", - target: "ethers-v5", + target: "ethers-v6", }, paths: { tests: "src/__tests__", diff --git a/package.json b/package.json index c9c1ec8..d34f067 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@nomiclabs/hardhat-waffle": "^2.0.3", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-typescript": "^11.0.0", - "@typechain/ethers-v5": "^10.0.0", + "@typechain/ethers-v6": "^0.4.0", "@typechain/hardhat": "^6.0.0", "@types/chai": "^4.3.1", "@types/chai-as-promised": "^7.1.5", diff --git a/src/utils/Eip712MerkleTree.ts b/src/utils/Eip712MerkleTree.ts index 3527ce8..3dc5a68 100644 --- a/src/utils/Eip712MerkleTree.ts +++ b/src/utils/Eip712MerkleTree.ts @@ -1,5 +1,5 @@ import { _TypedDataEncoder as TypedDataEncoder } from "@ethersproject/hash"; -import { keccak256, BytesLike } from "ethers/lib/utils"; +import { keccak256, BytesLike } from "ethers"; import { MerkleTree } from "merkletreejs"; import { EIP712TypedData } from "../types"; diff --git a/yarn.lock b/yarn.lock index 95fc4f7..fb1acc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1739,6 +1739,14 @@ lodash "^4.17.15" ts-essentials "^7.0.1" +"@typechain/ethers-v6@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v6/-/ethers-v6-0.4.0.tgz#fb9e9b8eeadc455fd1fc9048b2340309860deaca" + integrity sha512-vD3Agzz63Gf2XlU3ed2/y+8dLWQj+wf+4Eq+0JXsyOio/plyV5F6r0yYe+s3XdGI858U3Sr263pl8mliDrUqbw== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" + "@typechain/hardhat@^6.0.0": version "6.1.5" resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-6.1.5.tgz#caad58a1d3e9cd88061a584eb4f4fa763d5dcad1" From 16734536876a7b1d49ef45fa7de1815458a44fdb Mon Sep 17 00:00:00 2001 From: perryrare Date: Wed, 12 Jul 2023 08:08:04 -0400 Subject: [PATCH 03/10] feat: Typechain and contract updates --- doc/classes/LooksRare.LooksRare.md | 288 +++++++++--------- doc/interfaces/types.ContractMethods.md | 12 +- doc/interfaces/types.Referrer.md | 17 ++ doc/modules/types.md | 9 +- src/LooksRare.ts | 13 +- src/__tests__/eip712.test.ts | 4 +- .../looksrare/createMakerAsk.test.ts | 6 +- .../looksrare/executeCollectionOrder.test.ts | 2 +- .../executeCollectionOrderWithProof.test.ts | 1 - src/__tests__/looksrare/nonces.test.ts | 17 +- .../looksrare/orderValidator.test.ts | 1 - .../looksrare/signMakerOrders.test.ts | 4 +- src/constants/index.ts | 2 +- src/types.ts | 11 +- src/utils/Eip712MerkleTree.ts | 2 +- src/utils/calls/exchange.ts | 28 +- src/utils/calls/nonces.ts | 28 +- src/utils/calls/orderValidator.ts | 10 +- src/utils/calls/strategies.ts | 12 +- src/utils/calls/tokens.ts | 32 +- src/utils/calls/transferManager.ts | 26 +- src/utils/signMakerOrders.ts | 17 +- tsconfig.json | 16 +- 23 files changed, 275 insertions(+), 283 deletions(-) create mode 100644 doc/interfaces/types.Referrer.md diff --git a/doc/classes/LooksRare.LooksRare.md b/doc/classes/LooksRare.LooksRare.md index 95bfb83..a98d8d3 100644 --- a/doc/classes/LooksRare.LooksRare.md +++ b/doc/classes/LooksRare.LooksRare.md @@ -15,11 +15,11 @@ LooksRare protocol main class #### Parameters -| Name | Type | Description | -| :---------- | :---------------------------------------------- | :--------------------------------------------- | -| `chainId` | [`ChainId`](../enums/types.ChainId.md) | Current app chain id | -| `provider` | `Provider` | Ethers provider | -| `signer?` | [`Signer`](../modules/types.md#signer) | Ethers signer | +| Name | Type | Description | +| :------ | :------ | :------ | +| `chainId` | [`ChainId`](../enums/types.ChainId.md) | Current app chain id | +| `provider` | `JsonRpcProvider` | Ethers JsonRpc provider | +| `signer?` | `Signer` | Ethers signer | | `override?` | [`Addresses`](../interfaces/types.Addresses.md) | Overrides contract addresses for hardhat setup | ## Properties @@ -30,7 +30,7 @@ LooksRare protocol main class Mapping of LooksRare protocol addresses for the current chain ---- +___ ### chainId @@ -38,77 +38,77 @@ Mapping of LooksRare protocol addresses for the current chain Current app chain ID ---- +___ ### provider -• `Readonly` **provider**: `Provider` +• `Readonly` **provider**: `JsonRpcProvider` -Ethers multicall provider +Ethers JsonRPC provider with batch functionality **`See`** -- [Ethers providers doc](https://docs.ethers.io/v5/api/providers/) +[Ethers providers doc](https://docs.ethers.org/v6/api/providers/jsonrpc/#about-jsonrpcProvider) ---- +___ ### signer -• `Optional` `Readonly` **signer**: [`Signer`](../modules/types.md#signer) +• `Optional` `Readonly` **signer**: `Signer` Ethers signer **`See`** -[Ethers signer doc](https://docs.ethers.io/v5/api/signer/) +[Ethers signer doc](https://docs.ethers.org/v6/api/providers/#Signer) ## Methods ### approveAllCollectionItems -▸ **approveAllCollectionItems**(`collectionAddress`, `approved?`, `overrides?`): `Promise`<`ContractTransaction`\> +▸ **approveAllCollectionItems**(`collectionAddress`, `approved?`, `overrides?`): `Promise`<`ContractTransactionResponse`\> Approve all the items of a collection, to eventually be traded on LooksRare The spender is the TransferManager. #### Parameters -| Name | Type | Default value | Description | -| :------------------ | :---------- | :------------ | :-------------------------------------------------------------- | -| `collectionAddress` | `string` | `undefined` | Address of the collection to be approved. | -| `approved` | `boolean` | `true` | true to approve, false to revoke the approval (default to true) | -| `overrides?` | `Overrides` | `undefined` | - | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `collectionAddress` | `string` | `undefined` | Address of the collection to be approved. | +| `approved` | `boolean` | `true` | true to approve, false to revoke the approval (default to true) | +| `overrides?` | `Overrides` | `undefined` | - | #### Returns -`Promise`<`ContractTransaction`\> +`Promise`<`ContractTransactionResponse`\> ContractTransaction ---- +___ ### approveErc20 -▸ **approveErc20**(`tokenAddress`, `amount?`, `overrides?`): `Promise`<`ContractTransaction`\> +▸ **approveErc20**(`tokenAddress`, `amount?`, `overrides?`): `Promise`<`ContractTransactionResponse`\> Approve an ERC20 to be used as a currency on LooksRare. The spender is the LooksRareProtocol contract. #### Parameters -| Name | Type | Default value | Description | -| :------------- | :---------- | :--------------------- | :-------------------------------------------- | -| `tokenAddress` | `string` | `undefined` | Address of the ERC20 to approve | -| `amount` | `BigNumber` | `constants.MaxUint256` | Amount to be approved (default to MaxUint256) | -| `overrides?` | `Overrides` | `undefined` | - | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `tokenAddress` | `string` | `undefined` | Address of the ERC20 to approve | +| `amount` | `bigint` | `MaxUint256` | Amount to be approved (default to MaxUint256) | +| `overrides?` | `Overrides` | `undefined` | - | #### Returns -`Promise`<`ContractTransaction`\> +`Promise`<`ContractTransactionResponse`\> ContractTransaction ---- +___ ### cancelAllOrders @@ -118,11 +118,11 @@ Cancell all maker bid and/or ask orders for the current user #### Parameters -| Name | Type | Description | -| :----------- | :---------- | :-------------- | -| `bid` | `boolean` | Cancel all bids | -| `ask` | `boolean` | Cancel all asks | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :------ | :------ | :------ | +| `bid` | `boolean` | Cancel all bids | +| `ask` | `boolean` | Cancel all asks | +| `overrides?` | `Overrides` | - | #### Returns @@ -130,7 +130,7 @@ Cancell all maker bid and/or ask orders for the current user ContractMethods ---- +___ ### cancelOrders @@ -140,10 +140,10 @@ Cancel a list of specific orders #### Parameters -| Name | Type | Description | -| :----------- | :--------------- | :----------------------------- | -| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :------ | :------ | :------ | +| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | +| `overrides?` | `Overrides` | - | #### Returns @@ -151,7 +151,7 @@ Cancel a list of specific orders ContractMethods ---- +___ ### cancelSubsetOrders @@ -161,10 +161,10 @@ Cancel a list of specific subset orders #### Parameters -| Name | Type | Description | -| :----------- | :--------------- | :----------------------------- | -| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :------ | :------ | :------ | +| `nonces` | `BigNumberish`[] | List of nonces to be cancelled | +| `overrides?` | `Overrides` | - | #### Returns @@ -172,7 +172,7 @@ Cancel a list of specific subset orders ContractMethods ---- +___ ### createMakerAsk @@ -182,8 +182,8 @@ Create a maker ask object ready to be signed #### Parameters -| Name | Type | -| :----------------- | :------------------------------------------------------------ | +| Name | Type | +| :------ | :------ | | `CreateMakerInput` | [`CreateMakerInput`](../interfaces/types.CreateMakerInput.md) | #### Returns @@ -192,7 +192,7 @@ Create a maker ask object ready to be signed the maker object, isTransferManagerApproved, and isTransferManagerApproved ---- +___ ### createMakerBid @@ -202,8 +202,8 @@ Create a maker bid object ready to be signed #### Parameters -| Name | Type | -| :----------------- | :------------------------------------------------------------ | +| Name | Type | +| :------ | :------ | | `CreateMakerInput` | [`CreateMakerInput`](../interfaces/types.CreateMakerInput.md) | #### Returns @@ -212,7 +212,7 @@ Create a maker bid object ready to be signed the maker object, isCurrencyApproved, and isBalanceSufficient ---- +___ ### createMakerCollectionOffer @@ -226,9 +226,9 @@ this.createMakerBid #### Parameters -| Name | Type | Description | -| :------------ | :--------------------------------------------------------------------------------------- | :---------- | -| `orderInputs` | [`CreateMakerCollectionOfferInput`](../modules/types.md#createmakercollectionofferinput) | Order data | +| Name | Type | Description | +| :------ | :------ | :------ | +| `orderInputs` | [`CreateMakerCollectionOfferInput`](../modules/types.md#createmakercollectionofferinput) | Order data | #### Returns @@ -236,7 +236,7 @@ this.createMakerBid CreateMakerBidOutput ---- +___ ### createMakerCollectionOfferWithProof @@ -250,9 +250,9 @@ this.createMakerBid #### Parameters -| Name | Type | Description | -| :------------ | :--------------------------------------------------------------------------------------------------------- | :---------- | -| `orderInputs` | [`CreateMakerCollectionOfferWithProofInput`](../modules/types.md#createmakercollectionofferwithproofinput) | Order data | +| Name | Type | Description | +| :------ | :------ | :------ | +| `orderInputs` | [`CreateMakerCollectionOfferWithProofInput`](../modules/types.md#createmakercollectionofferwithproofinput) | Order data | #### Returns @@ -260,7 +260,7 @@ this.createMakerBid CreateMakerBidOutput ---- +___ ### createTaker @@ -270,11 +270,11 @@ Create a taker ask ready to be executed against a maker bid #### Parameters -| Name | Type | Default value | Description | -| :--------------------- | :-------------------------------------- | :------------ | :--------------------------------------------------------------- | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | Maker order that will be used as counterparty for the taker | -| `recipient` | `string` | `ZeroAddress` | Recipient address of the taker (if none, it will use the sender) | -| `additionalParameters` | `any`[] | `[]` | Additional parameters used to support complex orders | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | Maker order that will be used as counterparty for the taker | +| `recipient` | `string` | `ZeroAddress` | Recipient address of the taker (if none, it will use the sender) | +| `additionalParameters` | `any`[] | `[]` | Additional parameters used to support complex orders | #### Returns @@ -282,7 +282,7 @@ Create a taker ask ready to be executed against a maker bid Taker object ---- +___ ### createTakerCollectionOffer @@ -292,16 +292,16 @@ Create a taker ask order for collection order. **`See`** -- this.createTaker -- this.createMakerCollectionOffer + - this.createTaker + - this.createMakerCollectionOffer #### Parameters -| Name | Type | Description | -| :----------- | :-------------------------------------- | :--------------------------------------------------------------- | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | -| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | -| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | +| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | +| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | #### Returns @@ -309,7 +309,7 @@ Create a taker ask order for collection order. Taker object ---- +___ ### createTakerCollectionOfferWithProof @@ -319,17 +319,17 @@ Create a taker ask to fulfill a collection order (maker bid) created with a whit **`See`** -- this.createTaker -- this.createMakerCollectionOfferWithMerkleTree + - this.createTaker + - this.createMakerCollectionOfferWithMerkleTree #### Parameters -| Name | Type | Description | -| :----------- | :-------------------------------------- | :--------------------------------------------------------------- | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | -| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | -| `itemIds` | `BigNumberish`[] | List of token ids used during the maker creation | -| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | - | +| `itemId` | `BigNumberish` | Token id to use as a counterparty for the collection order | +| `itemIds` | `BigNumberish`[] | List of token ids used during the maker creation | +| `recipient?` | `string` | Recipient address of the taker (if none, it will use the sender) | #### Returns @@ -337,7 +337,7 @@ Create a taker ask to fulfill a collection order (maker bid) created with a whit Taker object ---- +___ ### executeMultipleOrders @@ -347,12 +347,12 @@ Execute several orders #### Parameters -| Name | Type | Default value | Description | -| :----------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :---------------------------------------------------- | -| `orders` | { `maker`: [`Maker`](../interfaces/types.Maker.md) ; `merkleTree?`: [`MerkleTree`](../interfaces/types.MerkleTree.md) ; `signature`: `string` ; `taker`: [`Taker`](../interfaces/types.Taker.md) }[] | `undefined` | List of orders data | -| `isAtomic` | `boolean` | `undefined` | Should the transaction revert or not if a trade fails | -| `affiliate` | `string` | `ZeroAddress` | Affiliate address | -| `overrides?` | `Overrides` | `undefined` | Call overrides | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `orders` | { `maker`: [`Maker`](../interfaces/types.Maker.md) ; `merkleTree?`: [`MerkleTree`](../interfaces/types.MerkleTree.md) ; `signature`: `string` ; `taker`: [`Taker`](../interfaces/types.Taker.md) }[] | `undefined` | List of orders data | +| `isAtomic` | `boolean` | `undefined` | Should the transaction revert or not if a trade fails | +| `affiliate` | `string` | `ZeroAddress` | Affiliate address | +| `overrides?` | `Overrides` | `undefined` | Call overrides | #### Returns @@ -360,13 +360,13 @@ Execute several orders ContractMethods -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------- | -| `call` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`ContractTransaction`\> | -| `callStatic` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`void`\> | -| `estimateGas` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`BigNumber`\> | +| Name | Type | +| :------ | :------ | +| `call` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`ContractTransactionResponse`\> | +| `callStatic` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`void`\> | +| `estimateGas` | (`additionalOverrides?`: `PayableOverrides`) => `Promise`<`bigint`\> | ---- +___ ### executeOrder @@ -376,14 +376,14 @@ Execute a trade #### Parameters -| Name | Type | Default value | Description | -| :----------- | :------------------------------------------------ | :------------------ | :---------------------------------------------- | -| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | - | -| `taker` | [`Taker`](../interfaces/types.Taker.md) | `undefined` | Taker order | -| `signature` | `string` | `undefined` | Signature of the maker order | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `maker` | [`Maker`](../interfaces/types.Maker.md) | `undefined` | - | +| `taker` | [`Taker`](../interfaces/types.Taker.md) | `undefined` | Taker order | +| `signature` | `string` | `undefined` | Signature of the maker order | | `merkleTree` | [`MerkleTree`](../interfaces/types.MerkleTree.md) | `defaultMerkleTree` | If the maker has been signed with a merkle tree | -| `affiliate` | `string` | `ZeroAddress` | Affiliate address if applicable | -| `overrides?` | `Overrides` | `undefined` | - | +| `affiliate` | `string` | `ZeroAddress` | Affiliate address if applicable | +| `overrides?` | `Overrides` | `undefined` | - | #### Returns @@ -391,21 +391,21 @@ Execute a trade ContractMethods ---- +___ ### getSigner -▸ `Private` **getSigner**(): [`Signer`](../modules/types.md#signer) +▸ `Private` **getSigner**(): `Signer` Return the signer it it's set, throw an exception otherwise #### Returns -[`Signer`](../modules/types.md#signer) +`Signer` Signer ---- +___ ### getTypedDataDomain @@ -419,7 +419,7 @@ Retrieve EIP-712 domain TypedDataDomain ---- +___ ### grantTransferManagerApproval @@ -433,10 +433,10 @@ Exchange address #### Parameters -| Name | Type | Description | -| :----------- | :---------- | :-------------------------------------------------- | -| `operators` | `string`[] | List of operators (default to the exchange address) | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :------ | :------ | :------ | +| `operators` | `string`[] | List of operators (default to the exchange address) | +| `overrides?` | `Overrides` | - | #### Returns @@ -444,7 +444,7 @@ Exchange address ContractMethods ---- +___ ### isTimestampValid @@ -454,8 +454,8 @@ Validate a timestamp format (seconds) #### Parameters -| Name | Type | -| :---------- | :------------- | +| Name | Type | +| :------ | :------ | | `timestamp` | `BigNumberish` | #### Returns @@ -464,7 +464,7 @@ Validate a timestamp format (seconds) boolean ---- +___ ### isTransferManagerApproved @@ -474,10 +474,10 @@ Check whether or not an operator has been approved by the user #### Parameters -| Name | Type | Description | -| :----------- | :---------- | :------------------------------------------------- | -| `operator` | `string` | Operator address (default to the exchange address) | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :------ | :------ | :------ | +| `operator` | `string` | Operator address (default to the exchange address) | +| `overrides?` | `Overrides` | - | #### Returns @@ -485,7 +485,7 @@ Check whether or not an operator has been approved by the user true if the operator is approved, false otherwise ---- +___ ### revokeTransferManagerApproval @@ -499,10 +499,10 @@ Exchange address #### Parameters -| Name | Type | Description | -| :----------- | :---------- | :---------------- | -| `operators` | `string`[] | List of operators | -| `overrides?` | `Overrides` | - | +| Name | Type | Description | +| :------ | :------ | :------ | +| `operators` | `string`[] | List of operators | +| `overrides?` | `Overrides` | - | #### Returns @@ -510,7 +510,7 @@ Exchange address ContractMethods ---- +___ ### signMakerOrder @@ -520,8 +520,8 @@ Sign a maker order using the signer provided in the constructor #### Parameters -| Name | Type | Description | -| :------ | :-------------------------------------- | :----------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `maker` | [`Maker`](../interfaces/types.Maker.md) | Order to be signed by the user | #### Returns @@ -530,7 +530,7 @@ Sign a maker order using the signer provided in the constructor Signature ---- +___ ### signMultipleMakerOrders @@ -541,8 +541,8 @@ Sign multiple maker orders with a single signature #### Parameters -| Name | Type | Description | -| :------------ | :---------------------------------------- | :-------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `makerOrders` | [`Maker`](../interfaces/types.Maker.md)[] | Array of maker orders | #### Returns @@ -551,7 +551,7 @@ Sign multiple maker orders with a single signature Signature, proofs, and Merkletree object ---- +___ ### strategyInfo @@ -561,10 +561,10 @@ Retrieve strategy info #### Parameters -| Name | Type | Description | -| :----------- | :----------------------------------------------- | :------------------------ | +| Name | Type | Description | +| :------ | :------ | :------ | | `strategyId` | [`StrategyType`](../enums/types.StrategyType.md) | use the enum StrategyType | -| `overrides?` | `Overrides` | - | +| `overrides?` | `Overrides` | - | #### Returns @@ -572,7 +572,7 @@ Retrieve strategy info StrategyInfo ---- +___ ### transferItemsAcrossCollection @@ -582,11 +582,11 @@ Transfer a list of items across different collections #### Parameters -| Name | Type | Description | -| :---------------- | :---------------------------------------------------------------- | :--------------------------------------------------------------------------- | -| `to` | `string` | Recipient address | +| Name | Type | Description | +| :------ | :------ | :------ | +| `to` | `string` | Recipient address | | `collectionItems` | [`BatchTransferItem`](../interfaces/types.BatchTransferItem.md)[] | Each object in the array represent a list of items for a specific collection | -| `overrides?` | `Overrides` | - | +| `overrides?` | `Overrides` | - | #### Returns @@ -594,7 +594,7 @@ Transfer a list of items across different collections ContractMethods ---- +___ ### verifyMakerOrders @@ -604,12 +604,12 @@ Verify if a set of orders can be executed (i.e are valid) #### Parameters -| Name | Type | Description | -| :------------- | :-------------------------------------------------- | :------------------------------ | -| `makerOrders` | [`Maker`](../interfaces/types.Maker.md)[] | List of maker orders | -| `signatures` | `string`[] | List of signatures | +| Name | Type | Description | +| :------ | :------ | :------ | +| `makerOrders` | [`Maker`](../interfaces/types.Maker.md)[] | List of maker orders | +| `signatures` | `string`[] | List of signatures | | `merkleTrees?` | [`MerkleTree`](../interfaces/types.MerkleTree.md)[] | List of merkle trees (optional) | -| `overrides?` | `Overrides` | - | +| `overrides?` | `Overrides` | - | #### Returns diff --git a/doc/interfaces/types.ContractMethods.md b/doc/interfaces/types.ContractMethods.md index a98afe4..8104131 100644 --- a/doc/interfaces/types.ContractMethods.md +++ b/doc/interfaces/types.ContractMethods.md @@ -8,11 +8,11 @@ Return type for any on chain call ### call -• **call**: (`additionalOverrides?`: `Overrides`) => `Promise`<`ContractTransaction`\> +• **call**: (`additionalOverrides?`: `Overrides`) => `Promise`<`ContractTransactionResponse`\> #### Type declaration -▸ (`additionalOverrides?`): `Promise`<`ContractTransaction`\> +▸ (`additionalOverrides?`): `Promise`<`ContractTransactionResponse`\> ##### Parameters @@ -22,7 +22,7 @@ Return type for any on chain call ##### Returns -`Promise`<`ContractTransaction`\> +`Promise`<`ContractTransactionResponse`\> ___ @@ -48,11 +48,11 @@ ___ ### estimateGas -• **estimateGas**: (`additionalOverrides?`: `Overrides`) => `Promise`<`BigNumber`\> +• **estimateGas**: (`additionalOverrides?`: `Overrides`) => `Promise`<`bigint`\> #### Type declaration -▸ (`additionalOverrides?`): `Promise`<`BigNumber`\> +▸ (`additionalOverrides?`): `Promise`<`bigint`\> ##### Parameters @@ -62,4 +62,4 @@ ___ ##### Returns -`Promise`<`BigNumber`\> +`Promise`<`bigint`\> diff --git a/doc/interfaces/types.Referrer.md b/doc/interfaces/types.Referrer.md new file mode 100644 index 0000000..0a243d9 --- /dev/null +++ b/doc/interfaces/types.Referrer.md @@ -0,0 +1,17 @@ +# Interface: Referrer + +[types](../modules/types.md).Referrer + +Referrer object to be used in maker order API + +## Properties + +### address + +• **address**: `string` + +___ + +### rate + +• **rate**: `BigNumberish` diff --git a/doc/modules/types.md b/doc/modules/types.md index e91df7b..51001a9 100644 --- a/doc/modules/types.md +++ b/doc/modules/types.md @@ -21,6 +21,7 @@ - [Maker](../interfaces/types.Maker.md) - [MerkleTree](../interfaces/types.MerkleTree.md) - [MerkleTreeProof](../interfaces/types.MerkleTreeProof.md) +- [Referrer](../interfaces/types.Referrer.md) - [SignMerkleTreeOrdersOutput](../interfaces/types.SignMerkleTreeOrdersOutput.md) - [StrategyInfo](../interfaces/types.StrategyInfo.md) - [Taker](../interfaces/types.Taker.md) @@ -49,13 +50,7 @@ ___ ### Signer -Ƭ **Signer**: `ethers.Signer` & `TypedDataSigner` - -Temporary type until full of TypedDataSigner in ethers V6 - -**`See`** - -[Ethers TypedDataSigner](https://github.com/ethers-io/ethers.js/blob/master/packages/abstract-signer/src.ts/index.ts#L53) +Ƭ **Signer**: `ethers.Signer` ___ diff --git a/src/LooksRare.ts b/src/LooksRare.ts index 541fc12..c1e290b 100644 --- a/src/LooksRare.ts +++ b/src/LooksRare.ts @@ -1,12 +1,13 @@ import { BigNumberish, - ContractTransaction, - Overrides, + ContractTransactionResponse, JsonRpcProvider, + MaxUint256, + Overrides, solidityPackedKeccak256, + TypedDataDomain, ZeroAddress, } from "ethers"; -import { TypedDataDomain } from "@ethersproject/abstract-signer"; import { MerkleTree as MerkleTreeJS } from "merkletreejs"; import { keccak256 } from "js-sha3"; import { addressesByNetwork } from "./constants/addresses"; @@ -494,7 +495,7 @@ export class LooksRare { collectionAddress: string, approved = true, overrides?: Overrides - ): Promise { + ): Promise { const signer = this.getSigner(); const spenderAddress = this.addresses.TRANSFER_MANAGER_V2; return setApprovalForAll(signer, collectionAddress, spenderAddress, approved, overrides); @@ -509,9 +510,9 @@ export class LooksRare { */ public approveErc20( tokenAddress: string, - amount: BigNumber = constants.MaxUint256, + amount: bigint = MaxUint256, overrides?: Overrides - ): Promise { + ): Promise { const signer = this.getSigner(); const spenderAddress = this.addresses.EXCHANGE_V2; return approve(signer, tokenAddress, spenderAddress, amount, overrides); diff --git a/src/__tests__/eip712.test.ts b/src/__tests__/eip712.test.ts index b2b5c85..7f8c845 100644 --- a/src/__tests__/eip712.test.ts +++ b/src/__tests__/eip712.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { AbiCoder, parseEther, utils } from "ethers"; +import { AbiCoder, parseEther } from "ethers"; import { TypedDataDomain } from "@ethersproject/abstract-signer"; import { setUpContracts, SetupMocks, getSigners, Signers } from "./helpers/setup"; import { computeDigestMaker, getDomainSeparator } from "./helpers/eip712"; @@ -31,7 +31,7 @@ describe("EIP-712", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: mocks.contracts.collectionERC721.address, + collection: await mocks.contracts.collectionERC721.getAddress(), currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), diff --git a/src/__tests__/looksrare/createMakerAsk.test.ts b/src/__tests__/looksrare/createMakerAsk.test.ts index 9327f9e..73dfcc0 100644 --- a/src/__tests__/looksrare/createMakerAsk.test.ts +++ b/src/__tests__/looksrare/createMakerAsk.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { constants, utils } from "ethers"; +import { ZeroAddress } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; @@ -71,7 +71,7 @@ describe("Create maker ask", () => { const output = await lrUser1.createMakerAsk(baseMakerAskInput); const makerOrder: Maker = { quoteType: QuoteType.Ask, - globalNonce: constants.Zero, + globalNonce: 0, subsetNonce: baseMakerAskInput.subsetNonce, strategyId: baseMakerAskInput.strategyId, collectionType: baseMakerAskInput.collectionType, @@ -101,7 +101,7 @@ describe("Create maker ask", () => { const output = await lrUser1.createMakerAsk(input); const makerOrder: Maker = { quoteType: QuoteType.Ask, - globalNonce: constants.Zero, + globalNonce: 0, subsetNonce: input.subsetNonce, strategyId: input.strategyId, collectionType: input.collectionType, diff --git a/src/__tests__/looksrare/executeCollectionOrder.test.ts b/src/__tests__/looksrare/executeCollectionOrder.test.ts index 4f12c76..d6fcdeb 100644 --- a/src/__tests__/looksrare/executeCollectionOrder.test.ts +++ b/src/__tests__/looksrare/executeCollectionOrder.test.ts @@ -1,10 +1,10 @@ import { expect } from "chai"; -import { utils } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { ownerOf, balanceOf } from "../helpers/tokens"; import { LooksRare } from "../../LooksRare"; import { ChainId, CollectionType, CreateMakerCollectionOfferInput } from "../../types"; +import { parseEther } from "ethers"; describe("execute collection order", () => { let mocks: SetupMocks; diff --git a/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts b/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts index f1f3f3a..ade8196 100644 --- a/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts +++ b/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts @@ -1,5 +1,4 @@ import { expect } from "chai"; -import { utils } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { ownerOf, balanceOf } from "../helpers/tokens"; diff --git a/src/__tests__/looksrare/nonces.test.ts b/src/__tests__/looksrare/nonces.test.ts index 272b9b5..a81f931 100644 --- a/src/__tests__/looksrare/nonces.test.ts +++ b/src/__tests__/looksrare/nonces.test.ts @@ -1,5 +1,4 @@ import { expect } from "chai"; -import { BigNumber } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { viewUserBidAskNonces } from "../../utils/calls/nonces"; @@ -19,19 +18,19 @@ describe("Nonces and order cancellation", () => { describe("cancelOrders", () => { it("cancel a nonce", async () => { - const tx = await lrUser1.cancelOrders([BigNumber.from(0)]).call(); + const tx = await lrUser1.cancelOrders([0]).call(); const receipt = await tx.wait(); expect(receipt.status).to.equal(1); }); it("cancel several nonces", async () => { - const tx = await lrUser1.cancelOrders([BigNumber.from(0), BigNumber.from(1)]).call(); + const tx = await lrUser1.cancelOrders([0, 1]).call(); const receipt = await tx.wait(); expect(receipt.status).to.equal(1); }); it("method analysis", async () => { - const contractMethods = lrUser1.cancelOrders([BigNumber.from(0), BigNumber.from(1)]); + const contractMethods = lrUser1.cancelOrders([0, 1]); const estimatedGas = await contractMethods.estimateGas(); expect(estimatedGas.toNumber()).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; @@ -40,19 +39,19 @@ describe("Nonces and order cancellation", () => { describe("cancelSubsetOrders", () => { it("cancel a subset nonce", async () => { - const tx = await lrUser1.cancelSubsetOrders([BigNumber.from(0)]).call(); + const tx = await lrUser1.cancelSubsetOrders([0]).call(); const receipt = await tx.wait(); expect(receipt.status).to.equal(1); }); it("cancel several subset nonces", async () => { - const tx = await lrUser1.cancelSubsetOrders([BigNumber.from(0), BigNumber.from(1)]).call(); + const tx = await lrUser1.cancelSubsetOrders([0, 1]).call(); const receipt = await tx.wait(); expect(receipt.status).to.equal(1); }); it("method analysis", async () => { - const contractMethods = lrUser1.cancelSubsetOrders([BigNumber.from(0), BigNumber.from(1)]); + const contractMethods = lrUser1.cancelSubsetOrders([0, 1]); const estimatedGas = await contractMethods.estimateGas(); expect(estimatedGas.toNumber()).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; @@ -76,8 +75,8 @@ describe("Nonces and order cancellation", () => { expect(receipt.status).to.equal(1); const userNonces = await viewUserBidAskNonces(signers.user1, mocks.addresses.EXCHANGE_V2, signers.user1.address); - expect(userNonces.bidNonce.eq(0)).to.be.true; - expect(userNonces.askNonce.gt(0)).to.be.true; + expect(userNonces.bidNonce).to.be.eq(0); + expect(userNonces.askNonce).to.be.gt(0); }); it("increment bid/ask nonces", async () => { diff --git a/src/__tests__/looksrare/orderValidator.test.ts b/src/__tests__/looksrare/orderValidator.test.ts index 27d1445..b13975d 100644 --- a/src/__tests__/looksrare/orderValidator.test.ts +++ b/src/__tests__/looksrare/orderValidator.test.ts @@ -1,5 +1,4 @@ import { expect } from "chai"; -import { utils } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; diff --git a/src/__tests__/looksrare/signMakerOrders.test.ts b/src/__tests__/looksrare/signMakerOrders.test.ts index 63fb90c..de9d74e 100644 --- a/src/__tests__/looksrare/signMakerOrders.test.ts +++ b/src/__tests__/looksrare/signMakerOrders.test.ts @@ -42,7 +42,7 @@ describe("Sign maker orders", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: collectionERC721.address, + collection: await collectionERC721.getAddress(), currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), @@ -71,7 +71,7 @@ describe("Sign maker orders", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: collectionERC721.address, + collection: await collectionERC721.getAddress(), currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), diff --git a/src/constants/index.ts b/src/constants/index.ts index ff9d563..20cb16e 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,4 +1,4 @@ -import { constants } from "ethers"; +import { ZeroHash } from "ethers"; /** Maximum amount of orders in a merkle tree * This limit is enforced in the contract with the value 2^10 (=1024) diff --git a/src/types.ts b/src/types.ts index 184cd1b..7f204ed 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,4 @@ -import { ethers, BigNumberish, BytesLike, ContractTransaction, Overrides } from "ethers"; -import { TypedDataSigner, TypedDataField } from "@ethersproject/abstract-signer"; +import { ethers, BigNumberish, BytesLike, Overrides, TypedDataField, ContractTransactionResponse } from "ethers"; import { Eip712MakerMerkleTree } from "./utils/Eip712MakerMerkleTree"; /** Addresses used to create a LooksRare instance */ @@ -83,15 +82,11 @@ export interface BatchTransferItem { amounts: BigNumberish[]; } -/** - * Temporary type until full of TypedDataSigner in ethers V6 - * @see {@link https://github.com/ethers-io/ethers.js/blob/master/packages/abstract-signer/src.ts/index.ts#L53 Ethers TypedDataSigner} - */ -export type Signer = ethers.Signer & TypedDataSigner; +export type Signer = ethers.Signer; /** Return type for any on chain call */ export interface ContractMethods { - call: (additionalOverrides?: Overrides) => Promise; + call: (additionalOverrides?: Overrides) => Promise; estimateGas: (additionalOverrides?: Overrides) => Promise; callStatic: (additionalOverrides?: Overrides) => Promise; } diff --git a/src/utils/Eip712MerkleTree.ts b/src/utils/Eip712MerkleTree.ts index 3dc5a68..730e4d2 100644 --- a/src/utils/Eip712MerkleTree.ts +++ b/src/utils/Eip712MerkleTree.ts @@ -1,4 +1,4 @@ -import { _TypedDataEncoder as TypedDataEncoder } from "@ethersproject/hash"; +import { TypedDataEncoder } from "ethers"; import { keccak256, BytesLike } from "ethers"; import { MerkleTree } from "merkletreejs"; import { EIP712TypedData } from "../types"; diff --git a/src/utils/calls/exchange.ts b/src/utils/calls/exchange.ts index d32c118..e8d2cc1 100644 --- a/src/utils/calls/exchange.ts +++ b/src/utils/calls/exchange.ts @@ -1,7 +1,8 @@ -import { Contract, PayableOverrides, BigNumber, ZeroAddress } from "ethers"; +import { Contract, ZeroAddress } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abiLooksRareProtocol from "../../abis/LooksRareProtocol.json"; import { Maker, MerkleTree, Taker, Signer, ContractMethods } from "../../types"; +import { PayableOverrides } from "../../typechain/common"; export const executeTakerBid = ( signer: Signer, @@ -17,7 +18,7 @@ export const executeTakerBid = ( ...overrides, ...(maker.currency === ZeroAddress && { value: maker.price }), }; - const contract = new Contract(address, abiLooksRareProtocol, signer) as LooksRareProtocol; + const contract = new Contract(address, abiLooksRareProtocol).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: PayableOverrides) => contract.executeTakerBid(taker, maker, makerSignature, merkleTree, affiliate, { @@ -25,12 +26,12 @@ export const executeTakerBid = ( ...additionalOverrides, }), estimateGas: (additionalOverrides?: PayableOverrides) => - contract.estimateGas.executeTakerBid(taker, maker, makerSignature, merkleTree, affiliate, { + contract.executeTakerBid.estimateGas(taker, maker, makerSignature, merkleTree, affiliate, { ...overridesWithValue, ...additionalOverrides, }), callStatic: (additionalOverrides?: PayableOverrides) => - contract.callStatic.executeTakerBid(taker, maker, makerSignature, merkleTree, affiliate, { + contract.executeTakerBid.staticCall(taker, maker, makerSignature, merkleTree, affiliate, { ...overridesWithValue, ...additionalOverrides, }), @@ -47,7 +48,7 @@ export const executeTakerAsk = ( affiliate: string, overrides?: PayableOverrides ): ContractMethods => { - const contract = new Contract(address, abiLooksRareProtocol, signer) as LooksRareProtocol; + const contract = new Contract(address, abiLooksRareProtocol).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: PayableOverrides) => contract.executeTakerAsk(taker, maker, makerSignature, merkleTree, affiliate, { @@ -55,12 +56,12 @@ export const executeTakerAsk = ( ...additionalOverrides, }), estimateGas: (additionalOverrides?: PayableOverrides) => - contract.estimateGas.executeTakerAsk(taker, maker, makerSignature, merkleTree, affiliate, { + contract.executeTakerAsk.estimateGas(taker, maker, makerSignature, merkleTree, affiliate, { ...overrides, ...additionalOverrides, }), callStatic: (additionalOverrides?: PayableOverrides) => - contract.callStatic.executeTakerAsk(taker, maker, makerSignature, merkleTree, affiliate, { + contract.executeTakerAsk.staticCall(taker, maker, makerSignature, merkleTree, affiliate, { ...overrides, ...additionalOverrides, }), @@ -78,15 +79,12 @@ export const executeMultipleTakerBids = ( affiliate: string, overrides?: PayableOverrides ) => { - const value = maker.reduce( - (acc, order) => (order.currency === ZeroAddress ? acc.add(order.price) : acc), - BigNumber.from(0) - ); + const value = maker.reduce((acc, order) => (order.currency === ZeroAddress ? acc + BigInt(order.price) : acc), 0n); const overridesWithValue: PayableOverrides = { ...overrides, - ...(value.gt(0) && { value }), + ...(value > 0 && { value }), }; - const contract = new Contract(address, abiLooksRareProtocol, signer) as LooksRareProtocol; + const contract = new Contract(address, abiLooksRareProtocol).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: PayableOverrides) => contract.executeMultipleTakerBids(taker, maker, makerSignature, merkleTree, affiliate, isAtomic, { @@ -94,12 +92,12 @@ export const executeMultipleTakerBids = ( ...additionalOverrides, }), estimateGas: (additionalOverrides?: PayableOverrides) => - contract.estimateGas.executeMultipleTakerBids(taker, maker, makerSignature, merkleTree, affiliate, isAtomic, { + contract.executeMultipleTakerBids.estimateGas(taker, maker, makerSignature, merkleTree, affiliate, isAtomic, { ...overridesWithValue, ...additionalOverrides, }), callStatic: (additionalOverrides?: PayableOverrides) => - contract.callStatic.executeMultipleTakerBids(taker, maker, makerSignature, merkleTree, affiliate, isAtomic, { + contract.executeMultipleTakerBids.staticCall(taker, maker, makerSignature, merkleTree, affiliate, isAtomic, { ...overridesWithValue, ...additionalOverrides, }), diff --git a/src/utils/calls/nonces.ts b/src/utils/calls/nonces.ts index c9205f4..f243617 100644 --- a/src/utils/calls/nonces.ts +++ b/src/utils/calls/nonces.ts @@ -1,15 +1,15 @@ -import { Contract, BigNumber, Overrides, CallOverrides, providers, BigNumberish } from "ethers"; +import { Contract, Overrides, BigNumberish, Provider } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abi from "../../abis/LooksRareProtocol.json"; import { Signer, ContractMethods } from "../../types"; export const viewUserBidAskNonces = async ( - signerOrProvider: providers.Provider | Signer, + signerOrProvider: Provider | Signer, address: string, account: string, - overrides?: CallOverrides -): Promise<{ bidNonce: BigNumber; askNonce: BigNumber }> => { - const contract = new Contract(address, abi, signerOrProvider) as LooksRareProtocol; + overrides?: Overrides +): Promise<{ bidNonce: bigint; askNonce: bigint }> => { + const contract = new Contract(address, abi).connect(signerOrProvider) as LooksRareProtocol; const nonces = await contract.userBidAskNonces(account, { ...overrides }); return { bidNonce: nonces[0], askNonce: nonces[1] }; }; @@ -20,14 +20,14 @@ export const cancelOrderNonces = ( nonces: BigNumberish[], overrides?: Overrides ): ContractMethods => { - const contract = new Contract(address, abi, signer) as LooksRareProtocol; + const contract = new Contract(address, abi).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: Overrides) => contract.cancelOrderNonces(nonces, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => - contract.estimateGas.cancelOrderNonces(nonces, { ...overrides, ...additionalOverrides }), + contract.cancelOrderNonces.estimateGas(nonces, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => - contract.callStatic.cancelOrderNonces(nonces, { ...overrides, ...additionalOverrides }), + contract.cancelOrderNonces.staticCall(nonces, { ...overrides, ...additionalOverrides }), }; }; @@ -37,14 +37,14 @@ export const cancelSubsetNonces = ( nonces: BigNumberish[], overrides?: Overrides ): ContractMethods => { - const contract = new Contract(address, abi, signer) as LooksRareProtocol; + const contract = new Contract(address, abi).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: Overrides) => contract.cancelSubsetNonces(nonces, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => - contract.estimateGas.cancelSubsetNonces(nonces, { ...overrides, ...additionalOverrides }), + contract.cancelSubsetNonces.estimateGas(nonces, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => - contract.callStatic.cancelSubsetNonces(nonces, { ...overrides, ...additionalOverrides }), + contract.cancelSubsetNonces.staticCall(nonces, { ...overrides, ...additionalOverrides }), }; }; @@ -55,13 +55,13 @@ export const incrementBidAskNonces = ( ask: boolean, overrides?: Overrides ): ContractMethods => { - const contract = new Contract(address, abi, signer) as LooksRareProtocol; + const contract = new Contract(address, abi).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: Overrides) => contract.incrementBidAskNonces(bid, ask, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => - contract.estimateGas.incrementBidAskNonces(bid, ask, { ...overrides, ...additionalOverrides }), + contract.incrementBidAskNonces.estimateGas(bid, ask, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => - contract.callStatic.incrementBidAskNonces(bid, ask, { ...overrides, ...additionalOverrides }), + contract.incrementBidAskNonces.staticCall(bid, ask, { ...overrides, ...additionalOverrides }), }; }; diff --git a/src/utils/calls/orderValidator.ts b/src/utils/calls/orderValidator.ts index 54214bb..bc79c4f 100644 --- a/src/utils/calls/orderValidator.ts +++ b/src/utils/calls/orderValidator.ts @@ -1,19 +1,19 @@ -import { Contract, CallOverrides, providers } from "ethers"; +import { Contract, Provider, Overrides } from "ethers"; import { OrderValidatorV2A } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/helpers/OrderValidatorV2A"; import abi from "../../abis/OrderValidatorV2A.json"; import { Signer, Maker, MerkleTree, OrderValidatorCode } from "../../types"; export const verifyMakerOrders = async ( - signerOrProvider: providers.Provider | Signer, + signerOrProvider: Provider | Signer, address: string, makerOrders: Maker[], signatures: string[], merkleTrees: MerkleTree[], - overrides?: CallOverrides + overrides?: Overrides ): Promise => { - const contract = new Contract(address, abi, signerOrProvider) as OrderValidatorV2A; + const contract = new Contract(address, abi).connect(signerOrProvider) as OrderValidatorV2A; const orders = await contract.checkMultipleMakerOrderValidities(makerOrders, signatures, merkleTrees, { ...overrides, }); - return orders.map((order) => order.map((code) => code.toNumber() as OrderValidatorCode)); + return orders.map((order) => order.map((code) => Number(code) as OrderValidatorCode)); }; diff --git a/src/utils/calls/strategies.ts b/src/utils/calls/strategies.ts index 11a0d34..935aaa5 100644 --- a/src/utils/calls/strategies.ts +++ b/src/utils/calls/strategies.ts @@ -1,4 +1,4 @@ -import { Contract, CallOverrides, Provider } from "ethers"; +import { Contract, Overrides, Provider } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abi from "../../abis/LooksRareProtocol.json"; import { Signer, StrategyType, StrategyInfo } from "../../types"; @@ -7,14 +7,14 @@ export const strategyInfo = async ( signerOrProvider: Provider | Signer, address: string, strategyId: StrategyType, - overrides?: CallOverrides + overrides?: Overrides ): Promise => { - const contract = new Contract(address, abi, signerOrProvider) as LooksRareProtocol; + const contract = new Contract(address, abi).connect(signerOrProvider) as LooksRareProtocol; const strategy = await contract.strategyInfo(strategyId, { ...overrides }); return { isActive: strategy.isActive, - standardProtocolFeeBp: strategy.standardProtocolFeeBp, - minTotalFeeBp: strategy.minTotalFeeBp, - maxProtocolFeeBp: strategy.maxProtocolFeeBp, + standardProtocolFeeBp: Number(strategy.standardProtocolFeeBp), + minTotalFeeBp: Number(strategy.minTotalFeeBp), + maxProtocolFeeBp: Number(strategy.maxProtocolFeeBp), }; }; diff --git a/src/utils/calls/tokens.ts b/src/utils/calls/tokens.ts index e9fadf4..93870f2 100644 --- a/src/utils/calls/tokens.ts +++ b/src/utils/calls/tokens.ts @@ -1,4 +1,4 @@ -import { Contract, providers, Overrides, CallOverrides, BigNumber, ContractTransaction } from "ethers"; +import { Contract, Provider, Overrides, ContractTransactionResponse } from "ethers"; import { ERC721 } from "../../typechain/solmate/src/tokens/ERC721.sol/ERC721"; import { ERC20 } from "../../typechain/solmate/src/tokens/ERC20"; import abiIERC721 from "../../abis/IERC721.json"; @@ -13,32 +13,32 @@ export const setApprovalForAll = ( operator: string, approved: boolean, overrides?: Overrides -): Promise => { - const contract = new Contract(collection, abiIERC721, signer) as ERC721; +): Promise => { + const contract = new Contract(collection, abiIERC721).connect(signer) as ERC721; return contract.setApprovalForAll(operator, approved, { ...overrides }); }; export const isApprovedForAll = ( - signerOrProvider: providers.Provider | Signer, + signerOrProvider: Provider | Signer, collection: string, account: string, operator: string, - overrides?: CallOverrides + overrides?: Overrides ): Promise => { - const contract = new Contract(collection, abiIERC721, signerOrProvider) as ERC721; + const contract = new Contract(collection, abiIERC721).connect(signerOrProvider) as ERC721; return contract.isApprovedForAll(account, operator, { ...overrides }); }; // ERC20 export const allowance = ( - signerOrProvider: providers.Provider | Signer, + signerOrProvider: Provider | Signer, currency: string, account: string, operator: string, overrides?: Overrides -): Promise => { - const contract = new Contract(currency, abiIERC20, signerOrProvider) as ERC20; +): Promise => { + const contract = new Contract(currency, abiIERC20).connect(signerOrProvider) as ERC20; return contract.allowance(account, operator, { ...overrides }); }; @@ -46,19 +46,19 @@ export const approve = ( signer: Signer, currency: string, operator: string, - amount: BigNumber, + amount: bigint, overrides?: Overrides -): Promise => { - const contract = new Contract(currency, abiIERC20, signer) as ERC20; +): Promise => { + const contract = new Contract(currency, abiIERC20).connect(signer) as ERC20; return contract.approve(operator, amount, { ...overrides }); }; export const balanceOf = ( - signerOrProvider: providers.Provider | Signer, + signerOrProvider: Provider | Signer, currency: string, account: string, - overrides?: CallOverrides -): Promise => { - const contract = new Contract(currency, abiIERC20, signerOrProvider) as ERC20; + overrides?: Overrides +): Promise => { + const contract = new Contract(currency, abiIERC20).connect(signerOrProvider) as ERC20; return contract.balanceOf(account, { ...overrides }); }; diff --git a/src/utils/calls/transferManager.ts b/src/utils/calls/transferManager.ts index d17d99b..6b1f938 100644 --- a/src/utils/calls/transferManager.ts +++ b/src/utils/calls/transferManager.ts @@ -1,16 +1,16 @@ -import { Contract, Overrides, CallOverrides, providers } from "ethers"; +import { Contract, Overrides, Provider } from "ethers"; import { TransferManager } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/TransferManager"; import abi from "../../abis/TransferManager.json"; import { Signer, ContractMethods, BatchTransferItem } from "../../types"; export const hasUserApprovedOperator = async ( - signerOrProvider: providers.Provider | Signer, + signerOrProvider: Provider | Signer, address: string, user: string, operator: string, - overrides?: CallOverrides + overrides?: Overrides ): Promise => { - const contract = new Contract(address, abi, signerOrProvider) as TransferManager; + const contract = new Contract(address, abi).connect(signerOrProvider) as TransferManager; const hasApproved = await contract.hasUserApprovedOperator(user, operator, { ...overrides }); return hasApproved; }; @@ -21,14 +21,14 @@ export const grantApprovals = ( operators: string[], overrides?: Overrides ): ContractMethods => { - const contract = new Contract(address, abi, signer) as TransferManager; + const contract = new Contract(address, abi).connect(signer) as TransferManager; return { call: (additionalOverrides?: Overrides) => contract.grantApprovals(operators, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => - contract.estimateGas.grantApprovals(operators, { ...overrides, ...additionalOverrides }), + contract.grantApprovals.estimateGas(operators, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => - contract.callStatic.grantApprovals(operators, { ...overrides, ...additionalOverrides }), + contract.grantApprovals.staticCall(operators, { ...overrides, ...additionalOverrides }), }; }; @@ -38,14 +38,14 @@ export const revokeApprovals = ( operators: string[], overrides?: Overrides ): ContractMethods => { - const contract = new Contract(address, abi, signer) as TransferManager; + const contract = new Contract(address, abi).connect(signer) as TransferManager; return { call: (additionalOverrides?: Overrides) => contract.revokeApprovals(operators, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => - contract.estimateGas.revokeApprovals(operators, { ...overrides, ...additionalOverrides }), + contract.revokeApprovals.estimateGas(operators, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => - contract.callStatic.revokeApprovals(operators, { ...overrides, ...additionalOverrides }), + contract.revokeApprovals.staticCall(operators, { ...overrides, ...additionalOverrides }), }; }; @@ -57,7 +57,7 @@ export const transferBatchItemsAcrossCollections = ( to: string, overrides?: Overrides ): ContractMethods => { - const contract = new Contract(address, abi, signer) as TransferManager; + const contract = new Contract(address, abi).connect(signer) as TransferManager; return { call: (additionalOverrides?: Overrides) => contract.transferBatchItemsAcrossCollections(items, from, to, { @@ -65,12 +65,12 @@ export const transferBatchItemsAcrossCollections = ( ...additionalOverrides, }), estimateGas: (additionalOverrides?: Overrides) => - contract.estimateGas.transferBatchItemsAcrossCollections(items, from, to, { + contract.transferBatchItemsAcrossCollections.estimateGas(items, from, to, { ...overrides, ...additionalOverrides, }), callStatic: (additionalOverrides?: Overrides) => - contract.callStatic.transferBatchItemsAcrossCollections(items, from, to, { + contract.transferBatchItemsAcrossCollections.staticCall(items, from, to, { ...overrides, ...additionalOverrides, }), diff --git a/src/utils/signMakerOrders.ts b/src/utils/signMakerOrders.ts index 9aecd4e..e1fcbd0 100644 --- a/src/utils/signMakerOrders.ts +++ b/src/utils/signMakerOrders.ts @@ -1,8 +1,7 @@ -import { TypedDataSigner, TypedDataDomain } from "@ethersproject/abstract-signer"; -import { ethers } from "ethers"; +import { ethers, TypedDataDomain } from "ethers"; import { Eip712MakerMerkleTree } from "./Eip712MakerMerkleTree"; import { makerTypes } from "./eip712"; -import { Maker, MerkleTree, SignMerkleTreeOrdersOutput } from "../types"; +import { Maker, MerkleTree, Signer, SignMerkleTreeOrdersOutput } from "../types"; /** * Sign a maker order @@ -11,12 +10,8 @@ import { Maker, MerkleTree, SignMerkleTreeOrdersOutput } from "../types"; * @param makerOrder Maker order * @returns Signature */ -export const signMakerOrder = async ( - signer: TypedDataSigner, - domain: TypedDataDomain, - makerOrder: Maker -): Promise => { - const signature = await signer._signTypedData(domain, makerTypes, makerOrder); +export const signMakerOrder = async (signer: Signer, domain: TypedDataDomain, makerOrder: Maker): Promise => { + const signature = await signer.signTypedData(domain, makerTypes, makerOrder); return ethers.Signature.from(signature).serialized; }; @@ -28,7 +23,7 @@ export const signMakerOrder = async ( * @returns Signature, array of proofs, and tree */ export const signMerkleTreeOrders = async ( - signer: TypedDataSigner, + signer: Signer, domain: TypedDataDomain, makerOrders: Maker[] ): Promise => { @@ -48,6 +43,6 @@ export const signMerkleTreeOrders = async ( }; }); - const signature = await signer._signTypedData(domain, tree.types, tree.getDataToSign()); + const signature = await signer.signTypedData(domain, tree.types, tree.getDataToSign()); return { signature: ethers.Signature.from(signature).serialized, merkleTreeProofs, tree }; }; diff --git a/tsconfig.json b/tsconfig.json index a830d7f..24e9978 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ @@ -9,9 +8,8 @@ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "target": "es2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ @@ -23,7 +21,6 @@ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ "module": "CommonJS" /* Specify what module code is generated. */, // "rootDir": "./", /* Specify the root folder within your source files. */ @@ -37,12 +34,10 @@ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ "resolveJsonModule": true /* Enable importing .json files. */, // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, // "declarationMap": true, /* Create sourcemaps for d.ts files. */ @@ -67,14 +62,12 @@ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ // "declarationDir": "./dist" /* Specify the output directory for generated declaration files. */, // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - /* Interop Constraints */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - /* Type Checking */ "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ @@ -95,10 +88,11 @@ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "include": ["src/**/*"] -} + "include": [ + "src/**/*" + ] +} \ No newline at end of file From ea78d09dfead44cf3e01275286340de51fdbd9c9 Mon Sep 17 00:00:00 2001 From: perryrare Date: Wed, 12 Jul 2023 13:42:22 -0400 Subject: [PATCH 04/10] fix: Broken tests --- package.json | 10 +-- src/__tests__/eip712.test.ts | 2 +- src/__tests__/helpers/setup.ts | 61 ++++++++++++------- src/__tests__/helpers/tokens.ts | 4 +- .../looksrare/createMakerAsk.test.ts | 8 +-- .../looksrare/createMakerBid.test.ts | 8 +-- src/__tests__/looksrare/createTaker.test.ts | 2 +- .../looksrare/executeCollectionOrder.test.ts | 10 +-- .../executeCollectionOrderWithProof.test.ts | 11 ++-- .../executeMultipleTakerBids.test.ts | 26 ++++---- .../looksrare/executeTakerAsk.test.ts | 10 +-- .../looksrare/executeTakerBid.test.ts | 12 ++-- src/__tests__/looksrare/nonces.test.ts | 32 +++++----- .../looksrare/orderValidator.test.ts | 5 +- .../looksrare/signMakerOrders.test.ts | 20 +++--- .../looksrare/transferManager.test.ts | 46 +++++++------- src/__tests__/tokens.test.ts | 24 ++++---- src/utils/calls/exchange.ts | 6 +- src/utils/calls/nonces.ts | 6 +- src/utils/calls/transferManager.ts | 6 +- src/utils/provider.ts | 7 --- yarn.lock | 56 +++++++++-------- 22 files changed, 196 insertions(+), 176 deletions(-) delete mode 100644 src/utils/provider.ts diff --git a/package.json b/package.json index d34f067..e56def9 100644 --- a/package.json +++ b/package.json @@ -50,12 +50,12 @@ "@istanbuljs/nyc-config-typescript": "^1.0.2", "@looksrare/contracts-exchange-v1": "^1.2.0", "@looksrare/contracts-exchange-v2": "^0.1.2", - "@nomiclabs/hardhat-ethers": "^2.0.6", - "@nomiclabs/hardhat-waffle": "^2.0.3", + "@nomiclabs/hardhat-ethers": "3.0.0-beta.0", + "@nomiclabs/hardhat-waffle": "^2.0.6", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-typescript": "^11.0.0", "@typechain/ethers-v6": "^0.4.0", - "@typechain/hardhat": "^6.0.0", + "@typechain/hardhat": "^8.0.0", "@types/chai": "^4.3.1", "@types/chai-as-promised": "^7.1.5", "@types/mocha": "^10.0.1", @@ -70,7 +70,7 @@ "eslint-plugin-prettier": "^4.2.1", "ethereum-waffle": "^4.0.10", "ethers": "^6.6.2", - "hardhat": "^2.13.0", + "hardhat": "^2.16.1", "hardhat-abi-exporter": "^2.9.0", "husky": "^8.0.1", "lint-staged": "^13.0.0", @@ -85,7 +85,7 @@ "solmate": "^6.6.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", - "typechain": "^8.0.0", + "typechain": "^8.2.0", "typedoc": "^0.24.7", "typedoc-plugin-markdown": "^3.15.3", "typescript": "^4.7.3" diff --git a/src/__tests__/eip712.test.ts b/src/__tests__/eip712.test.ts index 7f8c845..3964470 100644 --- a/src/__tests__/eip712.test.ts +++ b/src/__tests__/eip712.test.ts @@ -31,7 +31,7 @@ describe("EIP-712", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: await mocks.contracts.collectionERC721.getAddress(), + collection: mocks.addresses.MOCK_COLLECTION_ERC721, currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), diff --git a/src/__tests__/helpers/setup.ts b/src/__tests__/helpers/setup.ts index bddff07..1a46d90 100644 --- a/src/__tests__/helpers/setup.ts +++ b/src/__tests__/helpers/setup.ts @@ -1,5 +1,5 @@ /* eslint-disable no-await-in-loop */ -import { Contract, ContractTransaction, ZeroAddress, parseEther } from "ethers"; +import { ContractTransactionResponse, ZeroAddress, parseEther } from "ethers"; import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import { ethers } from "hardhat"; @@ -27,7 +27,10 @@ export interface SetupMocks { verifier: Verifier; orderValidator: OrderValidatorV2A; }; - addresses: Addresses; + addresses: Addresses & { + MOCK_COLLECTION_ERC721: string; + MOCK_COLLECTION_ERC1155: string; + }; } export interface Signers { @@ -53,71 +56,79 @@ export const getSigners = async (): Promise => { }; }; -const deploy = async (name: string, ...args: any[]): Promise => { +const deploy = async (name: string, ...args: any[]) => { const factory = await ethers.getContractFactory(name); const contract = await factory.deploy(...args); - await contract.deployed(); + await contract.waitForDeployment(); return contract; }; export const setUpContracts = async (): Promise => { const signers = await getSigners(); - let tx: ContractTransaction; + let tx: ContractTransactionResponse; // Deploy contracts const transferManager = (await deploy("TransferManager", signers.owner.address)) as TransferManager; const royaltyFeeRegistry = await deploy("MockRoyaltyFeeRegistry", signers.owner.address, 9500); const feeManager = (await deploy( "CreatorFeeManagerWithRoyalties", - royaltyFeeRegistry.address + await royaltyFeeRegistry.getAddress() )) as CreatorFeeManagerWithRoyalties; const weth = (await deploy("WETH")) as WETH; const looksRareProtocol = (await deploy( "LooksRareProtocol", signers.owner.address, signers.protocolFeeRecipient.address, - transferManager.address, - weth.address + await transferManager.getAddress(), + await weth.getAddress() )) as LooksRareProtocol; const strategyCollectionOffer = (await deploy("StrategyCollectionOffer")) as StrategyCollectionOffer; - tx = await looksRareProtocol.updateCreatorFeeManager(feeManager.address); + const addresses = { + weth: await weth.getAddress(), + looksRareProtocol: await looksRareProtocol.getAddress(), + strategyCollectionOffer: await strategyCollectionOffer.getAddress(), + transferManager: await transferManager.getAddress(), + feeManager: await feeManager.getAddress(), + }; + + tx = await looksRareProtocol.updateCreatorFeeManager.send(addresses.feeManager); await tx.wait(); tx = await looksRareProtocol.updateCurrencyStatus(ZeroAddress, true); await tx.wait(); - tx = await looksRareProtocol.updateCurrencyStatus(weth.address, true); + tx = await looksRareProtocol.updateCurrencyStatus(addresses.weth, true); await tx.wait(); - tx = await transferManager.allowOperator(looksRareProtocol.address); + tx = await transferManager.allowOperator(addresses.looksRareProtocol); await tx.wait(); tx = await looksRareProtocol.addStrategy( 250, 250, 300, - strategyCollectionOffer.interface.getSighash("executeCollectionStrategyWithTakerAsk"), + strategyCollectionOffer.interface.getFunction("executeCollectionStrategyWithTakerAsk").selector, true, - strategyCollectionOffer.address + addresses.strategyCollectionOffer ); tx = await looksRareProtocol.addStrategy( 250, 250, 300, - strategyCollectionOffer.interface.getSighash("executeCollectionStrategyWithTakerAskWithProof"), + strategyCollectionOffer.interface.getFunction("executeCollectionStrategyWithTakerAskWithProof").selector, true, - strategyCollectionOffer.address + addresses.strategyCollectionOffer ); await tx.wait(); - const orderValidator = (await deploy("OrderValidatorV2A", looksRareProtocol.address)) as OrderValidatorV2A; + const orderValidator = (await deploy("OrderValidatorV2A", addresses.looksRareProtocol)) as OrderValidatorV2A; const collectionERC721 = (await deploy("MockERC721", "collectionERC721", "COL1")) as MockERC721; const collectionERC1155 = (await deploy("MockERC1155")) as MockERC1155; - const verifier = (await deploy("Verifier", looksRareProtocol.address)) as Verifier; + const verifier = (await deploy("Verifier", addresses.looksRareProtocol)) as Verifier; // Setup balances - const wethUser1 = new ethers.Contract(weth.address, weth.interface, signers.user1); + const wethUser1 = new ethers.Contract(addresses.weth, weth.interface, signers.user1); tx = await wethUser1.deposit({ value: parseEther("10") }); await tx.wait(); - const wethUser2 = new ethers.Contract(weth.address, weth.interface, signers.user2); + const wethUser2 = new ethers.Contract(addresses.weth, weth.interface, signers.user2); tx = await wethUser2.deposit({ value: parseEther("10") }); await tx.wait(); @@ -141,13 +152,17 @@ export const setUpContracts = async (): Promise => { orderValidator, }, addresses: { - EXCHANGE_V2: looksRareProtocol.address, + EXCHANGE_V2: addresses.looksRareProtocol, LOOKS: ZeroAddress, - TRANSFER_MANAGER_V2: transferManager.address, - WETH: weth.address, - ORDER_VALIDATOR_V2: orderValidator.address, + TRANSFER_MANAGER_V2: addresses.transferManager, + WETH: addresses.weth, + ORDER_VALIDATOR_V2: await orderValidator.getAddress(), REVERSE_RECORDS: ZeroAddress, LOOKS_LP_V3: ZeroAddress, + MOCK_COLLECTION_ERC721: await collectionERC721.getAddress(), + MOCK_COLLECTION_ERC1155: await collectionERC1155.getAddress(), + STAKING_POOL_FOR_LOOKS_LP: ZeroAddress, + AGGREGATOR_UNISWAP_V3: ZeroAddress, }, }; }; diff --git a/src/__tests__/helpers/tokens.ts b/src/__tests__/helpers/tokens.ts index 599b4e0..87e0f85 100644 --- a/src/__tests__/helpers/tokens.ts +++ b/src/__tests__/helpers/tokens.ts @@ -4,11 +4,11 @@ import abiIERC721 from "../../abis/IERC721.json"; import { Signer } from "../../types"; export const balanceOf = async (signer: Signer, contractAddress: string, owner?: string, overrides?: Overrides) => { - const contract = new Contract(contractAddress, abiIERC721, signer) as ERC721; + const contract = new Contract(contractAddress, abiIERC721).connect(signer) as ERC721; return contract.balanceOf(owner ?? (await signer.getAddress()), { ...overrides }); }; export const ownerOf = async (signer: Signer, collection: string, id: BigNumberish, overrides?: Overrides) => { - const contract = new Contract(collection, abiIERC721, signer) as ERC721; + const contract = new Contract(collection, abiIERC721).connect(signer) as ERC721; return contract.ownerOf(id, { ...overrides }); }; diff --git a/src/__tests__/looksrare/createMakerAsk.test.ts b/src/__tests__/looksrare/createMakerAsk.test.ts index 73dfcc0..44c7ab9 100644 --- a/src/__tests__/looksrare/createMakerAsk.test.ts +++ b/src/__tests__/looksrare/createMakerAsk.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { ZeroAddress } from "ethers"; +import { ZeroAddress, parseEther } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; @@ -20,7 +20,7 @@ describe("Create maker ask", () => { lrUser1 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user1, mocks.addresses); baseMakerAskInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, @@ -71,7 +71,7 @@ describe("Create maker ask", () => { const output = await lrUser1.createMakerAsk(baseMakerAskInput); const makerOrder: Maker = { quoteType: QuoteType.Ask, - globalNonce: 0, + globalNonce: 0n, subsetNonce: baseMakerAskInput.subsetNonce, strategyId: baseMakerAskInput.strategyId, collectionType: baseMakerAskInput.collectionType, @@ -101,7 +101,7 @@ describe("Create maker ask", () => { const output = await lrUser1.createMakerAsk(input); const makerOrder: Maker = { quoteType: QuoteType.Ask, - globalNonce: 0, + globalNonce: 0n, subsetNonce: input.subsetNonce, strategyId: input.strategyId, collectionType: input.collectionType, diff --git a/src/__tests__/looksrare/createMakerBid.test.ts b/src/__tests__/looksrare/createMakerBid.test.ts index 63b5924..3d31275 100644 --- a/src/__tests__/looksrare/createMakerBid.test.ts +++ b/src/__tests__/looksrare/createMakerBid.test.ts @@ -20,7 +20,7 @@ describe("Create maker bid", () => { lrUser1 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user1, mocks.addresses); baseMakerInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, @@ -51,7 +51,7 @@ describe("Create maker bid", () => { signers.user1.address, mocks.addresses.EXCHANGE_V2 ); - expect(valueApproved.eq(MaxUint256)).to.be.true; + expect(valueApproved).to.be.eq(MaxUint256); }); it("approval checks are true if approval were made", async () => { @@ -78,7 +78,7 @@ describe("Create maker bid", () => { const output = await lrUser1.createMakerBid(baseMakerInput); const makerOrder: Maker = { quoteType: QuoteType.Bid, - globalNonce: 0, + globalNonce: 0n, subsetNonce: baseMakerInput.subsetNonce, strategyId: baseMakerInput.strategyId, collectionType: baseMakerInput.collectionType, @@ -108,7 +108,7 @@ describe("Create maker bid", () => { const output = await lrUser1.createMakerBid(input); const makerOrder: Maker = { quoteType: QuoteType.Bid, - globalNonce: 0, + globalNonce: 0n, subsetNonce: input.subsetNonce, strategyId: input.strategyId, collectionType: input.collectionType, diff --git a/src/__tests__/looksrare/createTaker.test.ts b/src/__tests__/looksrare/createTaker.test.ts index 0df251e..b57e249 100644 --- a/src/__tests__/looksrare/createTaker.test.ts +++ b/src/__tests__/looksrare/createTaker.test.ts @@ -19,7 +19,7 @@ describe("Create takers", () => { lrUser1 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user1, mocks.addresses); baseMakerInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, diff --git a/src/__tests__/looksrare/executeCollectionOrder.test.ts b/src/__tests__/looksrare/executeCollectionOrder.test.ts index d6fcdeb..3b15bbc 100644 --- a/src/__tests__/looksrare/executeCollectionOrder.test.ts +++ b/src/__tests__/looksrare/executeCollectionOrder.test.ts @@ -20,7 +20,7 @@ describe("execute collection order", () => { lrUser2 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user2, mocks.addresses); collectionOfferInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, subsetNonce: 0, orderNonce: 0, @@ -35,7 +35,7 @@ describe("execute collection order", () => { tx = await lrUser2.approveErc20(mocks.addresses.WETH); await tx.wait(); - tx = await lrUser1.approveAllCollectionItems(mocks.contracts.collectionERC721.address); + tx = await lrUser1.approveAllCollectionItems(mocks.addresses.MOCK_COLLECTION_ERC721); await tx.wait(); }); @@ -46,7 +46,7 @@ describe("execute collection order", () => { const contractMethods = lrUser1.executeOrder(maker, taker, signature); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); @@ -60,12 +60,12 @@ describe("execute collection order", () => { const contractMethods = lrUser1.executeOrder(maker, taker, signature); const receipt = await (await contractMethods.call()).wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); const owner = await ownerOf(signers.user2, collectionOfferInput.collection, itemId); expect(owner).to.be.equal(signers.user2.address); const user1UpdatedBalance = await balanceOf(signers.user1, mocks.addresses.WETH); - expect(user1UpdatedBalance.gt(user1InitialBalance)).to.be.true; + expect(user1UpdatedBalance > user1InitialBalance).to.be.true; }); }); diff --git a/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts b/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts index ade8196..2419bbc 100644 --- a/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts +++ b/src/__tests__/looksrare/executeCollectionOrderWithProof.test.ts @@ -4,6 +4,7 @@ import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setu import { ownerOf, balanceOf } from "../helpers/tokens"; import { LooksRare } from "../../LooksRare"; import { ChainId, CollectionType, CreateMakerCollectionOfferInput } from "../../types"; +import { parseEther } from "ethers"; describe("execute collection order with proof", () => { let mocks: SetupMocks; @@ -20,7 +21,7 @@ describe("execute collection order with proof", () => { lrUser2 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user2, mocks.addresses); collectionOfferInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, subsetNonce: 0, orderNonce: 0, @@ -35,7 +36,7 @@ describe("execute collection order with proof", () => { tx = await lrUser2.approveErc20(mocks.addresses.WETH); await tx.wait(); - tx = await lrUser1.approveAllCollectionItems(mocks.contracts.collectionERC721.address); + tx = await lrUser1.approveAllCollectionItems(mocks.addresses.MOCK_COLLECTION_ERC721); await tx.wait(); }); @@ -50,7 +51,7 @@ describe("execute collection order with proof", () => { const contractMethods = lrUser1.executeOrder(maker, taker, signature); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); @@ -68,12 +69,12 @@ describe("execute collection order with proof", () => { const { call } = lrUser1.executeOrder(maker, taker, signature); const receipt = await (await call()).wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); const owner = await ownerOf(signers.user2, collectionOfferInput.collection, itemId); expect(owner).to.be.equal(signers.user2.address); const user1UpdatedBalance = await balanceOf(signers.user1, mocks.addresses.WETH); - expect(user1UpdatedBalance.gt(user1InitialBalance)).to.be.true; + expect(user1UpdatedBalance > user1InitialBalance).to.be.true; }); }); diff --git a/src/__tests__/looksrare/executeMultipleTakerBids.test.ts b/src/__tests__/looksrare/executeMultipleTakerBids.test.ts index 80888f3..3d5985a 100644 --- a/src/__tests__/looksrare/executeMultipleTakerBids.test.ts +++ b/src/__tests__/looksrare/executeMultipleTakerBids.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { utils } from "ethers"; +import { parseEther } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { ownerOf } from "../helpers/tokens"; @@ -21,7 +21,7 @@ describe("execute multiple taker bids", () => { lrUser2 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user2, mocks.addresses); const baseMakerAskInput: CreateMakerInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, @@ -59,7 +59,7 @@ describe("execute multiple taker bids", () => { const contractMethods = lrUser2.executeMultipleOrders(orders, true); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); @@ -73,17 +73,17 @@ describe("execute multiple taker bids", () => { { maker: makers[0], taker: taker1, signature: signature1 }, { maker: makers[1], taker: taker2, signature: signature2 }, ]; - const user1InitialBalance = await signers.user1.getBalance(); + const user1InitialBalance = await ethers.provider.getBalance(signers.user1.address); const contractMethods = lrUser2.executeMultipleOrders(orders, true); const receipt = await (await contractMethods.call()).wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); const owner = await ownerOf(signers.user2, makers[0].collection, makers[0].itemIds[0]); expect(owner).to.be.equal(signers.user2.address); - const user1UpdatedBalance = await signers.user1.getBalance(); - expect(user1UpdatedBalance.gt(user1InitialBalance)).to.be.true; + const user1UpdatedBalance = await ethers.provider.getBalance(signers.user1.address); + expect(user1UpdatedBalance > user1InitialBalance).to.be.true; }); it("execute multiple taker bid non atomically", async () => { @@ -96,7 +96,7 @@ describe("execute multiple taker bids", () => { { maker: makers[0], taker: taker1, signature: signature1 }, { maker: makers[1], taker: taker2, signature: signature2 }, ]; - const user1InitialBalance = await signers.user1.getBalance(); + const user1InitialBalance = await ethers.provider.getBalance(signers.user1.address); const contractMethods = lrUser2.executeMultipleOrders(orders, false); const receipt = await (await contractMethods.call()).wait(); @@ -105,8 +105,8 @@ describe("execute multiple taker bids", () => { const owner = await ownerOf(signers.user2, makers[0].collection, makers[0].itemIds[0]); expect(owner).to.be.equal(signers.user2.address); - const user1UpdatedBalance = await signers.user1.getBalance(); - expect(user1UpdatedBalance.gt(user1InitialBalance)).to.be.true; + const user1UpdatedBalance = await ethers.provider.getBalance(signers.user1.address); + expect(user1UpdatedBalance > user1InitialBalance).to.be.true; }); it("execute multiple taker bid with a merkle tree", async () => { @@ -118,7 +118,7 @@ describe("execute multiple taker bids", () => { { maker: makers[0], taker: taker1, signature: signature, merkleTree: merkleTreeProofs[0] }, { maker: makers[1], taker: taker2, signature: signature, merkleTree: merkleTreeProofs[1] }, ]; - const user1InitialBalance = await signers.user1.getBalance(); + const user1InitialBalance = await ethers.provider.getBalance(signers.user1.address); const contractMethods = lrUser2.executeMultipleOrders(orders, true); const receipt = await (await contractMethods.call()).wait(); @@ -127,8 +127,8 @@ describe("execute multiple taker bids", () => { const owner = await ownerOf(signers.user2, makers[0].collection, makers[0].itemIds[0]); expect(owner).to.be.equal(signers.user2.address); - const user1UpdatedBalance = await signers.user1.getBalance(); - expect(user1UpdatedBalance.gt(user1InitialBalance)).to.be.true; + const user1UpdatedBalance = await ethers.provider.getBalance(signers.user1.address); + expect(user1UpdatedBalance > user1InitialBalance).to.be.true; }); it("throw when the quote type is incorrect", async () => { diff --git a/src/__tests__/looksrare/executeTakerAsk.test.ts b/src/__tests__/looksrare/executeTakerAsk.test.ts index 9df0d7f..576e8b1 100644 --- a/src/__tests__/looksrare/executeTakerAsk.test.ts +++ b/src/__tests__/looksrare/executeTakerAsk.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { utils } from "ethers"; +import { parseEther, utils } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; @@ -20,7 +20,7 @@ describe("execute taker ask", () => { lrUser2 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user2, mocks.addresses); baseMakerAskInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, @@ -49,7 +49,7 @@ describe("execute taker ask", () => { const contractMethods = lrUser1.executeOrder(maker, taker, signature); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); @@ -62,7 +62,7 @@ describe("execute taker ask", () => { const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); }); it("execute maker bid from a merkle tree signature, and taker ask", async () => { @@ -75,6 +75,6 @@ describe("execute taker ask", () => { const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); }); }); diff --git a/src/__tests__/looksrare/executeTakerBid.test.ts b/src/__tests__/looksrare/executeTakerBid.test.ts index 70d38af..48f0367 100644 --- a/src/__tests__/looksrare/executeTakerBid.test.ts +++ b/src/__tests__/looksrare/executeTakerBid.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { utils } from "ethers"; +import { parseEther, utils } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; @@ -19,7 +19,7 @@ describe("execute taker bid", () => { lrUser2 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user2, mocks.addresses); baseMakerAskInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, @@ -47,7 +47,7 @@ describe("execute taker bid", () => { const contractMethods = lrUser2.executeOrder(maker, taker, signature); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); @@ -61,7 +61,7 @@ describe("execute taker bid", () => { const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); }); it("execute maker ask and taker bid with WETH", async () => { @@ -73,7 +73,7 @@ describe("execute taker bid", () => { const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); }); it("execute maker ask from a merkle tree signature and taker bid", async () => { @@ -86,6 +86,6 @@ describe("execute taker bid", () => { const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.be.equal(1); + expect(receipt?.status).to.be.equal(1); }); }); diff --git a/src/__tests__/looksrare/nonces.test.ts b/src/__tests__/looksrare/nonces.test.ts index a81f931..90feb31 100644 --- a/src/__tests__/looksrare/nonces.test.ts +++ b/src/__tests__/looksrare/nonces.test.ts @@ -20,19 +20,19 @@ describe("Nonces and order cancellation", () => { it("cancel a nonce", async () => { const tx = await lrUser1.cancelOrders([0]).call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); }); it("cancel several nonces", async () => { const tx = await lrUser1.cancelOrders([0, 1]).call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); }); it("method analysis", async () => { const contractMethods = lrUser1.cancelOrders([0, 1]); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); }); @@ -41,19 +41,19 @@ describe("Nonces and order cancellation", () => { it("cancel a subset nonce", async () => { const tx = await lrUser1.cancelSubsetOrders([0]).call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); }); it("cancel several subset nonces", async () => { const tx = await lrUser1.cancelSubsetOrders([0, 1]).call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); }); it("method analysis", async () => { const contractMethods = lrUser1.cancelSubsetOrders([0, 1]); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); }); @@ -62,37 +62,37 @@ describe("Nonces and order cancellation", () => { it("increment bid nonce", async () => { const tx = await lrUser1.cancelAllOrders(true, false).call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); const userNonces = await viewUserBidAskNonces(signers.user1, mocks.addresses.EXCHANGE_V2, signers.user1.address); - expect(userNonces.bidNonce.gt(0)).to.be.true; - expect(userNonces.askNonce.eq(0)).to.be.true; + expect(userNonces.bidNonce > 0n).to.be.true; + expect(userNonces.askNonce).to.be.eq(0n); }); it("increment ask nonce", async () => { const tx = await lrUser1.cancelAllOrders(false, true).call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); const userNonces = await viewUserBidAskNonces(signers.user1, mocks.addresses.EXCHANGE_V2, signers.user1.address); - expect(userNonces.bidNonce).to.be.eq(0); - expect(userNonces.askNonce).to.be.gt(0); + expect(userNonces.bidNonce).to.be.eq(0n); + expect(userNonces.askNonce > 0n).to.be.true; }); it("increment bid/ask nonces", async () => { const tx = await lrUser1.cancelAllOrders(true, true).call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); const userNonces = await viewUserBidAskNonces(signers.user1, mocks.addresses.EXCHANGE_V2, signers.user1.address); - expect(userNonces.bidNonce.gt(0)).to.be.true; - expect(userNonces.askNonce.gt(0)).to.be.true; + expect(userNonces.bidNonce > 0n).to.be.true; + expect(userNonces.askNonce > 0n).to.be.true; }); it("method analysis", async () => { const contractMethods = lrUser1.cancelAllOrders(true, true); const estimatedGas = await lrUser1.cancelAllOrders(true, true).estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; }); }); diff --git a/src/__tests__/looksrare/orderValidator.test.ts b/src/__tests__/looksrare/orderValidator.test.ts index b13975d..481f70b 100644 --- a/src/__tests__/looksrare/orderValidator.test.ts +++ b/src/__tests__/looksrare/orderValidator.test.ts @@ -3,6 +3,7 @@ import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; import { ChainId, CollectionType, StrategyType, CreateMakerInput, OrderValidatorCode } from "../../types"; +import { parseEther } from "ethers"; describe("Order validation", () => { let mocks: SetupMocks; @@ -18,7 +19,7 @@ describe("Order validation", () => { lrUser1 = new LooksRare(ChainId.HARDHAT, ethers.provider, signers.user1, mocks.addresses); baseMakerAskInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, @@ -30,7 +31,7 @@ describe("Order validation", () => { }; baseMakerBidInput = { - collection: mocks.contracts.collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, strategyId: StrategyType.standard, subsetNonce: 0, diff --git a/src/__tests__/looksrare/signMakerOrders.test.ts b/src/__tests__/looksrare/signMakerOrders.test.ts index de9d74e..add85cd 100644 --- a/src/__tests__/looksrare/signMakerOrders.test.ts +++ b/src/__tests__/looksrare/signMakerOrders.test.ts @@ -58,7 +58,7 @@ describe("Sign maker orders", () => { expect(verifyTypedData(domain, makerTypes, makerOrder, signature)).to.equal(signers.user1.address); await expect(verifier.verifySignature(makerOrder, signature)).to.eventually.be.fulfilled; await expect(verifier.verifySignature(makerOrder, faultySignature)).to.eventually.be.rejectedWith( - "call revert exception" + /reverted with/ ); }); @@ -87,14 +87,14 @@ describe("Sign maker orders", () => { expect(verifyTypedData(domain, makerTypes, makerOrder, signature)).to.equal(signers.user1.address); await expect(verifier.verifySignature(makerOrder, signature)).to.eventually.be.fulfilled; await expect(verifier.verifySignature(makerOrder, faultySignature)).to.eventually.be.rejectedWith( - "call revert exception" + /reverted with/ ); }); }); describe("Sign multiple maker orders", () => { it("sign multiple maker bid order (merkle tree)", async () => { - const { collectionERC721, verifier } = mocks.contracts; + const { verifier } = mocks.contracts; const makerOrders: Maker[] = [ { quoteType: QuoteType.Bid, @@ -103,7 +103,7 @@ describe("Sign maker orders", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), @@ -120,7 +120,7 @@ describe("Sign maker orders", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), @@ -137,7 +137,7 @@ describe("Sign maker orders", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), @@ -158,12 +158,11 @@ describe("Sign maker orders", () => { await expect(verifier.verifyMerkleTree(merkleTreeProof, signature, signerAddress)).to.eventually.be.fulfilled; await expect( verifier.verifyMerkleTree(merkleTreeProof, faultySignature, signerAddress) - ).to.eventually.be.rejectedWith("call revert exception"); + ).to.eventually.be.rejectedWith(/reverted with/); }); }); it("sign orders when number of orders = MAX_ORDERS_PER_TREE", async () => { - const { collectionERC721 } = mocks.contracts; const makerOrders: Maker[] = [...Array(MAX_ORDERS_PER_TREE)].map(() => ({ quoteType: QuoteType.Bid, globalNonce: 1, @@ -171,7 +170,7 @@ describe("Sign maker orders", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), @@ -186,7 +185,6 @@ describe("Sign maker orders", () => { }); it("revert if number of orders > MAX_ORDERS_PER_TREE", async () => { - const { collectionERC721 } = mocks.contracts; const makerOrders: Maker[] = [...Array(MAX_ORDERS_PER_TREE + 1)].map(() => ({ quoteType: QuoteType.Bid, globalNonce: 1, @@ -194,7 +192,7 @@ describe("Sign maker orders", () => { strategyId: 1, collectionType: CollectionType.ERC721, orderNonce: 1, - collection: collectionERC721.address, + collection: mocks.addresses.MOCK_COLLECTION_ERC721, currency: mocks.addresses.WETH, signer: signers.user1.address, startTime: Math.floor(Date.now() / 1000), diff --git a/src/__tests__/looksrare/transferManager.test.ts b/src/__tests__/looksrare/transferManager.test.ts index b2eb9b9..569d713 100644 --- a/src/__tests__/looksrare/transferManager.test.ts +++ b/src/__tests__/looksrare/transferManager.test.ts @@ -34,13 +34,13 @@ describe("Transfer manager", () => { const contractMethods = lrUser1.grantTransferManagerApproval(); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); }); it("revoke operator approvals", async () => { @@ -48,20 +48,22 @@ describe("Transfer manager", () => { const contractMethods = lrUser1.revokeTransferManagerApproval(); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); }); it("transfer items from a single collection", async () => { - const { contracts } = mocks; - await (await lrUser1.approveAllCollectionItems(contracts.collectionERC721.address)).wait(); + const { addresses } = mocks; + await (await lrUser1.approveAllCollectionItems(addresses.MOCK_COLLECTION_ERC721)).wait(); await (await lrUser1.grantTransferManagerApproval().call()).wait(); - const collectionERC721 = new Contract(contracts.collectionERC721.address, abiIERC721, ethers.provider) as ERC721; + const collectionERC721 = new Contract(addresses.MOCK_COLLECTION_ERC721, abiIERC721).connect( + ethers.provider + ) as ERC721; const receipient = signers.user3.address; const tokenId = 0; @@ -72,7 +74,7 @@ describe("Transfer manager", () => { const items: BatchTransferItem[] = [ { - collection: contracts.collectionERC721.address, + collection: addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, itemIds: [tokenId], amounts: [1], @@ -81,13 +83,13 @@ describe("Transfer manager", () => { const contractMethods = await lrUser1.transferItemsAcrossCollection(receipient, items); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); // Check the new owner const newOwner = await collectionERC721.ownerOf(tokenId); @@ -95,14 +97,14 @@ describe("Transfer manager", () => { }); it("transfer items from multiple collections", async () => { - const { contracts } = mocks; - await (await lrUser1.approveAllCollectionItems(contracts.collectionERC721.address)).wait(); - await (await lrUser1.approveAllCollectionItems(contracts.collectionERC1155.address)).wait(); + const { addresses } = mocks; + await (await lrUser1.approveAllCollectionItems(addresses.MOCK_COLLECTION_ERC721)).wait(); + await (await lrUser1.approveAllCollectionItems(addresses.MOCK_COLLECTION_ERC1155)).wait(); (await lrUser1.grantTransferManagerApproval().call()).wait(); - const collectionERC721 = new Contract(contracts.collectionERC721.address, abiIERC721, ethers.provider) as ERC721; - const collectionERC1155 = new Contract( - contracts.collectionERC1155.address, - abiIERC1155, + const collectionERC721 = new Contract(addresses.MOCK_COLLECTION_ERC721, abiIERC721).connect( + ethers.provider + ) as ERC721; + const collectionERC1155 = new Contract(addresses.MOCK_COLLECTION_ERC1155, abiIERC1155).connect( ethers.provider ) as ERC1155; @@ -111,13 +113,13 @@ describe("Transfer manager", () => { // Execute the transfer const items: BatchTransferItem[] = [ { - collection: contracts.collectionERC721.address, + collection: addresses.MOCK_COLLECTION_ERC721, collectionType: CollectionType.ERC721, itemIds: [0], amounts: [1], }, { - collection: contracts.collectionERC1155.address, + collection: addresses.MOCK_COLLECTION_ERC1155, collectionType: CollectionType.ERC1155, itemIds: [0], amounts: [10], @@ -126,18 +128,18 @@ describe("Transfer manager", () => { const contractMethods = await lrUser1.transferItemsAcrossCollection(receipient, items); const estimatedGas = await contractMethods.estimateGas(); - expect(estimatedGas.toNumber()).to.be.greaterThan(0); + expect(Number(estimatedGas)).to.be.greaterThan(0); await expect(contractMethods.callStatic()).to.eventually.be.fulfilled; const tx = await contractMethods.call(); const receipt = await tx.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); // Check the new owner const newOwner = await collectionERC721.ownerOf(0); expect(newOwner).to.be.equal(receipient); const newBalance = await collectionERC1155.balanceOf(receipient, 0); - expect(newBalance).to.be.equal(10); + expect(newBalance).to.be.equal(10n); }); }); diff --git a/src/__tests__/tokens.test.ts b/src/__tests__/tokens.test.ts index 204c81c..6892b1d 100644 --- a/src/__tests__/tokens.test.ts +++ b/src/__tests__/tokens.test.ts @@ -13,36 +13,37 @@ describe("Tokens", () => { it("approve ERC721", async () => { const provider = ethers.provider; const { collectionERC721 } = mocks.contracts; + const collectionERC721Address = await collectionERC721.getAddress(); let isApproved = await isApprovedForAll( provider, - collectionERC721.address, + collectionERC721Address, signers.user1.address, signers.operator.address ); expect(isApproved).to.be.false; // Approve - let transaction = await setApprovalForAll(signers.user1, collectionERC721.address, signers.operator.address, true); + let transaction = await setApprovalForAll(signers.user1, collectionERC721Address, signers.operator.address, true); let receipt = await transaction.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); isApproved = await isApprovedForAll( provider, - collectionERC721.address, + collectionERC721Address, signers.user1.address, signers.operator.address ); expect(isApproved).to.be.true; // Cancel approval - transaction = await setApprovalForAll(signers.user1, collectionERC721.address, signers.operator.address, false); + transaction = await setApprovalForAll(signers.user1, collectionERC721Address, signers.operator.address, false); receipt = await transaction.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); isApproved = await isApprovedForAll( provider, - collectionERC721.address, + collectionERC721Address, signers.user1.address, signers.operator.address ); @@ -51,10 +52,11 @@ describe("Tokens", () => { it("approve ERC1155", async () => { const provider = ethers.provider; const { collectionERC1155 } = mocks.contracts; + const collectionERC1155Address = await collectionERC1155.getAddress(); let isApproved = await isApprovedForAll( provider, - collectionERC1155.address, + collectionERC1155Address, signers.user2.address, signers.operator.address ); @@ -62,16 +64,16 @@ describe("Tokens", () => { const transaction = await setApprovalForAll( signers.user2, - collectionERC1155.address, + collectionERC1155Address, signers.operator.address, true ); const receipt = await transaction.wait(); - expect(receipt.status).to.equal(1); + expect(receipt?.status).to.equal(1); isApproved = await isApprovedForAll( provider, - collectionERC1155.address, + collectionERC1155Address, signers.user2.address, signers.operator.address ); diff --git a/src/utils/calls/exchange.ts b/src/utils/calls/exchange.ts index e8d2cc1..ba75361 100644 --- a/src/utils/calls/exchange.ts +++ b/src/utils/calls/exchange.ts @@ -21,7 +21,7 @@ export const executeTakerBid = ( const contract = new Contract(address, abiLooksRareProtocol).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: PayableOverrides) => - contract.executeTakerBid(taker, maker, makerSignature, merkleTree, affiliate, { + contract.executeTakerBid.send(taker, maker, makerSignature, merkleTree, affiliate, { ...overridesWithValue, ...additionalOverrides, }), @@ -51,7 +51,7 @@ export const executeTakerAsk = ( const contract = new Contract(address, abiLooksRareProtocol).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: PayableOverrides) => - contract.executeTakerAsk(taker, maker, makerSignature, merkleTree, affiliate, { + contract.executeTakerAsk.send(taker, maker, makerSignature, merkleTree, affiliate, { ...overrides, ...additionalOverrides, }), @@ -87,7 +87,7 @@ export const executeMultipleTakerBids = ( const contract = new Contract(address, abiLooksRareProtocol).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: PayableOverrides) => - contract.executeMultipleTakerBids(taker, maker, makerSignature, merkleTree, affiliate, isAtomic, { + contract.executeMultipleTakerBids.send(taker, maker, makerSignature, merkleTree, affiliate, isAtomic, { ...overridesWithValue, ...additionalOverrides, }), diff --git a/src/utils/calls/nonces.ts b/src/utils/calls/nonces.ts index f243617..80ebde2 100644 --- a/src/utils/calls/nonces.ts +++ b/src/utils/calls/nonces.ts @@ -23,7 +23,7 @@ export const cancelOrderNonces = ( const contract = new Contract(address, abi).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: Overrides) => - contract.cancelOrderNonces(nonces, { ...overrides, ...additionalOverrides }), + contract.cancelOrderNonces.send(nonces, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => contract.cancelOrderNonces.estimateGas(nonces, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => @@ -40,7 +40,7 @@ export const cancelSubsetNonces = ( const contract = new Contract(address, abi).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: Overrides) => - contract.cancelSubsetNonces(nonces, { ...overrides, ...additionalOverrides }), + contract.cancelSubsetNonces.send(nonces, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => contract.cancelSubsetNonces.estimateGas(nonces, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => @@ -58,7 +58,7 @@ export const incrementBidAskNonces = ( const contract = new Contract(address, abi).connect(signer) as LooksRareProtocol; return { call: (additionalOverrides?: Overrides) => - contract.incrementBidAskNonces(bid, ask, { ...overrides, ...additionalOverrides }), + contract.incrementBidAskNonces.send(bid, ask, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => contract.incrementBidAskNonces.estimateGas(bid, ask, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => diff --git a/src/utils/calls/transferManager.ts b/src/utils/calls/transferManager.ts index 6b1f938..113f0c0 100644 --- a/src/utils/calls/transferManager.ts +++ b/src/utils/calls/transferManager.ts @@ -24,7 +24,7 @@ export const grantApprovals = ( const contract = new Contract(address, abi).connect(signer) as TransferManager; return { call: (additionalOverrides?: Overrides) => - contract.grantApprovals(operators, { ...overrides, ...additionalOverrides }), + contract.grantApprovals.send(operators, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => contract.grantApprovals.estimateGas(operators, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => @@ -41,7 +41,7 @@ export const revokeApprovals = ( const contract = new Contract(address, abi).connect(signer) as TransferManager; return { call: (additionalOverrides?: Overrides) => - contract.revokeApprovals(operators, { ...overrides, ...additionalOverrides }), + contract.revokeApprovals.send(operators, { ...overrides, ...additionalOverrides }), estimateGas: (additionalOverrides?: Overrides) => contract.revokeApprovals.estimateGas(operators, { ...overrides, ...additionalOverrides }), callStatic: (additionalOverrides?: Overrides) => @@ -60,7 +60,7 @@ export const transferBatchItemsAcrossCollections = ( const contract = new Contract(address, abi).connect(signer) as TransferManager; return { call: (additionalOverrides?: Overrides) => - contract.transferBatchItemsAcrossCollections(items, from, to, { + contract.transferBatchItemsAcrossCollections.send(items, from, to, { ...overrides, ...additionalOverrides, }), diff --git a/src/utils/provider.ts b/src/utils/provider.ts deleted file mode 100644 index a40b79d..0000000 --- a/src/utils/provider.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { FetchRequest, JsonRpcApiProviderOptions, JsonRpcProvider, Networkish } from "ethers"; - -export class BatchProvider extends JsonRpcProvider { - constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions) { - super(url, network, options); - } -} diff --git a/yarn.lock b/yarn.lock index fb1acc8..e8f7486 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1375,15 +1375,15 @@ "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" -"@nomiclabs/hardhat-ethers@^2.0.6": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0" - integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg== +"@nomiclabs/hardhat-ethers@3.0.0-beta.0": + version "3.0.0-beta.0" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-3.0.0-beta.0.tgz#0ab529b9977e8354dd8e29d750f9cb5109948d5e" + integrity sha512-oV0PZ+UPFiLjV2wVKxYP/OXCJhcqGMTvoVQG2di4EE/2pqgEGDGXdPNfDiRemv6UfK8aGvtvsmU+hM+OrPR7fQ== -"@nomiclabs/hardhat-waffle@^2.0.3": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.5.tgz#97c217f1db795395c04404291937edb528f3f218" - integrity sha512-U1RH9OQ1mWYQfb+moX5aTgGjpVVlOcpiFI47wwnaGG4kLhcTy90cNiapoqZenxcRAITVbr0/+QSduINL5EsUIQ== +"@nomiclabs/hardhat-waffle@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.6.tgz#d11cb063a5f61a77806053e54009c40ddee49a54" + integrity sha512-+Wz0hwmJGSI17B+BhU/qFRZ1l6/xMW82QGXE/Gi+WTmwgJrQefuBs1lIf7hzQ1hLk6hpkvb/zwcNkpVKRYTQYg== "@octokit/auth-token@^3.0.0": version "3.0.3" @@ -1747,10 +1747,10 @@ lodash "^4.17.15" ts-essentials "^7.0.1" -"@typechain/hardhat@^6.0.0": - version "6.1.5" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-6.1.5.tgz#caad58a1d3e9cd88061a584eb4f4fa763d5dcad1" - integrity sha512-lg7LW4qDZpxFMknp3Xool61Fg6Lays8F8TXdFGBG+MxyYcYU5795P1U2XdStuzGq9S2Dzdgh+1jGww9wvZ6r4Q== +"@typechain/hardhat@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-8.0.0.tgz#60568b7a2d0260cc741fb0830a8caee8eb06ac64" + integrity sha512-XUVbqlMx8tJTOmzZCD/r196CidtNWAnTBZRcYxjLTKgcJMvc/kHQpWBnVMMB5QHxVKpYpCiz8g07FYCpG8rrjA== dependencies: fs-extra "^9.1.0" @@ -4554,10 +4554,10 @@ hardhat-abi-exporter@^2.9.0: "@ethersproject/abi" "^5.5.0" delete-empty "^3.0.0" -hardhat@^2.13.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.14.0.tgz#b60c74861494aeb1b50803cf04cc47865a42b87a" - integrity sha512-73jsInY4zZahMSVFurSK+5TNCJTXMv+vemvGia0Ac34Mm19fYp6vEPVGF3sucbumszsYxiTT2TbS8Ii2dsDSoQ== +hardhat@^2.16.1: + version "2.16.1" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.16.1.tgz#fd2288ce44f6846a70ba332b3d8158522447262a" + integrity sha512-QpBjGXFhhSYoYBGEHyoau/A63crZOP+i3GbNxzLGkL6IklzT+piN14+wGnINNCg5BLSKisQI/RAySPzaWRcx/g== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" @@ -4598,7 +4598,6 @@ hardhat@^2.13.0: mnemonist "^0.38.0" mocha "^10.0.0" p-map "^4.0.0" - qs "^6.7.0" raw-body "^2.4.1" resolve "1.17.0" semver "^6.3.0" @@ -6821,13 +6820,6 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qs@^6.7.0: - version "6.11.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.1.tgz#6c29dff97f0c0060765911ba65cbc9764186109f" - integrity sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ== - dependencies: - side-channel "^1.0.4" - qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" @@ -8035,6 +8027,22 @@ typechain@^8.0.0: ts-command-line-args "^2.2.0" ts-essentials "^7.0.1" +typechain@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.2.0.tgz#bd4fc8f111d4405e36858bae6f744604617b60f3" + integrity sha512-tZqhqjxJ9xAS/Lh32jccTjMkpx7sTdUVVHAy5Bf0TIer5QFNYXotiX74oCvoVYjyxUKDK3MXHtMFzMyD3kE+jg== + dependencies: + "@types/prettier" "^2.1.1" + debug "^4.3.1" + fs-extra "^7.0.0" + glob "7.1.7" + js-sha3 "^0.8.0" + lodash "^4.17.15" + mkdirp "^1.0.4" + prettier "^2.3.1" + ts-command-line-args "^2.2.0" + ts-essentials "^7.0.1" + typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" From 81a72892bb455463397d8fd978473b874846ed37 Mon Sep 17 00:00:00 2001 From: perryrare Date: Wed, 12 Jul 2023 13:45:52 -0400 Subject: [PATCH 05/10] chore: Remove unused waffle packages --- hardhat.config.ts | 1 - package.json | 2 - yarn.lock | 1057 +-------------------------------------------- 3 files changed, 21 insertions(+), 1039 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index b9f1e40..129c140 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,4 +1,3 @@ -import "@nomiclabs/hardhat-waffle"; import "@nomiclabs/hardhat-ethers"; import "@typechain/hardhat"; import "hardhat-abi-exporter"; diff --git a/package.json b/package.json index e56def9..b892f76 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "@looksrare/contracts-exchange-v1": "^1.2.0", "@looksrare/contracts-exchange-v2": "^0.1.2", "@nomiclabs/hardhat-ethers": "3.0.0-beta.0", - "@nomiclabs/hardhat-waffle": "^2.0.6", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-typescript": "^11.0.0", "@typechain/ethers-v6": "^0.4.0", @@ -68,7 +67,6 @@ "eslint": "^8.17.0", "eslint-config-prettier": "^8.7.0", "eslint-plugin-prettier": "^4.2.1", - "ethereum-waffle": "^4.0.10", "ethers": "^6.6.2", "hardhat": "^2.16.1", "hardhat-abi-exporter": "^2.9.0", diff --git a/yarn.lock b/yarn.lock index e8f7486..8a24e48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -472,133 +472,6 @@ bufio "^1.0.7" chai "^4.3.4" -"@ethereum-waffle/chai@4.0.10": - version "4.0.10" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-4.0.10.tgz#6f600a40b6fdaed331eba42b8625ff23f3a0e59a" - integrity sha512-X5RepE7Dn8KQLFO7HHAAe+KeGaX/by14hn90wePGBhzL54tq4Y8JscZFu+/LCwCl6TnkAAy5ebiMoqJ37sFtWw== - dependencies: - "@ethereum-waffle/provider" "4.0.5" - debug "^4.3.4" - json-bigint "^1.0.0" - -"@ethereum-waffle/compiler@4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-4.0.3.tgz#069e2df24b879b8a7b78857bad6f8bf6ebc8a5b1" - integrity sha512-5x5U52tSvEVJS6dpCeXXKvRKyf8GICDwiTwUvGD3/WD+DpvgvaoHOL82XqpTSUHgV3bBq6ma5/8gKUJUIAnJCw== - dependencies: - "@resolver-engine/imports" "^0.3.3" - "@resolver-engine/imports-fs" "^0.3.3" - "@typechain/ethers-v5" "^10.0.0" - "@types/mkdirp" "^0.5.2" - "@types/node-fetch" "^2.6.1" - mkdirp "^0.5.1" - node-fetch "^2.6.7" - -"@ethereum-waffle/ens@4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-4.0.3.tgz#4a46ac926414f3c83b4e8cc2562c8e2aee06377a" - integrity sha512-PVLcdnTbaTfCrfSOrvtlA9Fih73EeDvFS28JQnT5M5P4JMplqmchhcZB1yg/fCtx4cvgHlZXa0+rOCAk2Jk0Jw== - -"@ethereum-waffle/mock-contract@4.0.4": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-4.0.4.tgz#f13fea29922d87a4d2e7c4fc8fe72ea04d2c13de" - integrity sha512-LwEj5SIuEe9/gnrXgtqIkWbk2g15imM/qcJcxpLyAkOj981tQxXmtV4XmQMZsdedEsZ/D/rbUAOtZbgwqgUwQA== - -"@ethereum-waffle/provider@4.0.5": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-4.0.5.tgz#8a65dbf0263f4162c9209608205dee1c960e716b" - integrity sha512-40uzfyzcrPh+Gbdzv89JJTMBlZwzya1YLDyim8mVbEqYLP5VRYWoGp0JMyaizgV3hMoUFRqJKVmIUw4v7r3hYw== - dependencies: - "@ethereum-waffle/ens" "4.0.3" - "@ganache/ethereum-options" "0.1.4" - debug "^4.3.4" - ganache "7.4.3" - -"@ethereumjs/block@^3.5.0", "@ethereumjs/block@^3.6.0", "@ethereumjs/block@^3.6.2": - version "3.6.3" - resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.6.3.tgz#d96cbd7af38b92ebb3424223dbf773f5ccd27f84" - integrity sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg== - dependencies: - "@ethereumjs/common" "^2.6.5" - "@ethereumjs/tx" "^3.5.2" - ethereumjs-util "^7.1.5" - merkle-patricia-tree "^4.2.4" - -"@ethereumjs/blockchain@^5.5.0": - version "5.5.3" - resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.5.3.tgz#aa49a6a04789da6b66b5bcbb0d0b98efc369f640" - integrity sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw== - dependencies: - "@ethereumjs/block" "^3.6.2" - "@ethereumjs/common" "^2.6.4" - "@ethereumjs/ethash" "^1.1.0" - debug "^4.3.3" - ethereumjs-util "^7.1.5" - level-mem "^5.0.1" - lru-cache "^5.1.1" - semaphore-async-await "^1.5.1" - -"@ethereumjs/common@2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.0.tgz#feb96fb154da41ee2cc2c5df667621a440f36348" - integrity sha512-Cq2qS0FTu6O2VU1sgg+WyU9Ps0M6j/BEMHN+hRaECXCV/r0aI78u4N6p52QW/BDVhwWZpCdrvG8X7NJdzlpNUA== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.3" - -"@ethereumjs/common@^2.6.0", "@ethereumjs/common@^2.6.4", "@ethereumjs/common@^2.6.5": - version "2.6.5" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.5.tgz#0a75a22a046272579d91919cb12d84f2756e8d30" - integrity sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.5" - -"@ethereumjs/ethash@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.1.0.tgz#7c5918ffcaa9cb9c1dc7d12f77ef038c11fb83fb" - integrity sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA== - dependencies: - "@ethereumjs/block" "^3.5.0" - "@types/levelup" "^4.3.0" - buffer-xor "^2.0.1" - ethereumjs-util "^7.1.1" - miller-rabin "^4.0.0" - -"@ethereumjs/tx@3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.4.0.tgz#7eb1947eefa55eb9cf05b3ca116fb7a3dbd0bce7" - integrity sha512-WWUwg1PdjHKZZxPPo274ZuPsJCWV3SqATrEKQP1n2DrVYVP1aZIYpo/mFaA0BDoE0tIQmBeimRCEA0Lgil+yYw== - dependencies: - "@ethereumjs/common" "^2.6.0" - ethereumjs-util "^7.1.3" - -"@ethereumjs/tx@^3.4.0", "@ethereumjs/tx@^3.5.2": - version "3.5.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.2.tgz#197b9b6299582ad84f9527ca961466fce2296c1c" - integrity sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw== - dependencies: - "@ethereumjs/common" "^2.6.4" - ethereumjs-util "^7.1.5" - -"@ethereumjs/vm@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.6.0.tgz#e0ca62af07de820143674c30b776b86c1983a464" - integrity sha512-J2m/OgjjiGdWF2P9bj/4LnZQ1zRoZhY8mRNVw/N3tXliGI8ai1sI1mlDPkLpeUUM4vq54gH6n0ZlSpz8U/qlYQ== - dependencies: - "@ethereumjs/block" "^3.6.0" - "@ethereumjs/blockchain" "^5.5.0" - "@ethereumjs/common" "^2.6.0" - "@ethereumjs/tx" "^3.4.0" - async-eventemitter "^0.2.4" - core-js-pure "^3.0.1" - debug "^2.2.0" - ethereumjs-util "^7.1.3" - functional-red-black-tree "^1.0.1" - mcl-wasm "^0.7.1" - merkle-patricia-tree "^4.2.2" - rustbn.js "~0.2.0" - "@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" @@ -941,68 +814,6 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ganache/ethereum-address@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@ganache/ethereum-address/-/ethereum-address-0.1.4.tgz#0e6d66f4a24f64bf687cb3ff7358fb85b9d9005e" - integrity sha512-sTkU0M9z2nZUzDeHRzzGlW724xhMLXo2LeX1hixbnjHWY1Zg1hkqORywVfl+g5uOO8ht8T0v+34IxNxAhmWlbw== - dependencies: - "@ganache/utils" "0.1.4" - -"@ganache/ethereum-options@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@ganache/ethereum-options/-/ethereum-options-0.1.4.tgz#6a559abb44225e2b8741a8f78a19a46714a71cd6" - integrity sha512-i4l46taoK2yC41FPkcoDlEVoqHS52wcbHPqJtYETRWqpOaoj9hAg/EJIHLb1t6Nhva2CdTO84bG+qlzlTxjAHw== - dependencies: - "@ganache/ethereum-address" "0.1.4" - "@ganache/ethereum-utils" "0.1.4" - "@ganache/options" "0.1.4" - "@ganache/utils" "0.1.4" - bip39 "3.0.4" - seedrandom "3.0.5" - -"@ganache/ethereum-utils@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@ganache/ethereum-utils/-/ethereum-utils-0.1.4.tgz#fae4b5b9e642e751ff1fa0cd7316c92996317257" - integrity sha512-FKXF3zcdDrIoCqovJmHLKZLrJ43234Em2sde/3urUT/10gSgnwlpFmrv2LUMAmSbX3lgZhW/aSs8krGhDevDAg== - dependencies: - "@ethereumjs/common" "2.6.0" - "@ethereumjs/tx" "3.4.0" - "@ethereumjs/vm" "5.6.0" - "@ganache/ethereum-address" "0.1.4" - "@ganache/rlp" "0.1.4" - "@ganache/utils" "0.1.4" - emittery "0.10.0" - ethereumjs-abi "0.6.8" - ethereumjs-util "7.1.3" - -"@ganache/options@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@ganache/options/-/options-0.1.4.tgz#325b07e6de85094667aaaaf3d653e32404a04b78" - integrity sha512-zAe/craqNuPz512XQY33MOAG6Si1Xp0hCvfzkBfj2qkuPcbJCq6W/eQ5MB6SbXHrICsHrZOaelyqjuhSEmjXRw== - dependencies: - "@ganache/utils" "0.1.4" - bip39 "3.0.4" - seedrandom "3.0.5" - -"@ganache/rlp@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@ganache/rlp/-/rlp-0.1.4.tgz#f4043afda83e1a14a4f80607b103daf166a9b374" - integrity sha512-Do3D1H6JmhikB+6rHviGqkrNywou/liVeFiKIpOBLynIpvZhRCgn3SEDxyy/JovcaozTo/BynHumfs5R085MFQ== - dependencies: - "@ganache/utils" "0.1.4" - rlp "2.2.6" - -"@ganache/utils@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@ganache/utils/-/utils-0.1.4.tgz#25d60d7689e3dda6a8a7ad70e3646f07c2c39a1f" - integrity sha512-oatUueU3XuXbUbUlkyxeLLH3LzFZ4y5aSkNbx6tjSIhVTPeh+AuBKYt4eQ73FFcTB3nj/gZoslgAh5CN7O369w== - dependencies: - emittery "0.10.0" - keccak "3.0.1" - seedrandom "3.0.5" - optionalDependencies: - "@trufflesuite/bigint-buffer" "1.1.9" - "@humanwhocodes/config-array@^0.11.8": version "0.11.8" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" @@ -1380,11 +1191,6 @@ resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-3.0.0-beta.0.tgz#0ab529b9977e8354dd8e29d750f9cb5109948d5e" integrity sha512-oV0PZ+UPFiLjV2wVKxYP/OXCJhcqGMTvoVQG2di4EE/2pqgEGDGXdPNfDiRemv6UfK8aGvtvsmU+hM+OrPR7fQ== -"@nomiclabs/hardhat-waffle@^2.0.6": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.6.tgz#d11cb063a5f61a77806053e54009c40ddee49a54" - integrity sha512-+Wz0hwmJGSI17B+BhU/qFRZ1l6/xMW82QGXE/Gi+WTmwgJrQefuBs1lIf7hzQ1hLk6hpkvb/zwcNkpVKRYTQYg== - "@octokit/auth-token@^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.3.tgz#ce7e48a3166731f26068d7a7a7996b5da58cbe0c" @@ -1522,43 +1328,6 @@ "@pnpm/network.ca-file" "^1.0.1" config-chain "^1.1.11" -"@resolver-engine/core@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" - integrity sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ== - dependencies: - debug "^3.1.0" - is-url "^1.2.4" - request "^2.85.0" - -"@resolver-engine/fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" - integrity sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports-fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" - integrity sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA== - dependencies: - "@resolver-engine/fs" "^0.3.3" - "@resolver-engine/imports" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" - integrity sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - hosted-git-info "^2.6.0" - path-browserify "^1.0.0" - url "^0.11.0" - "@rollup/plugin-json@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-6.0.0.tgz#199fea6670fd4dfb1f4932250569b14719db234a" @@ -1697,20 +1466,6 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@trufflesuite/bigint-buffer@1.1.10": - version "1.1.10" - resolved "https://registry.yarnpkg.com/@trufflesuite/bigint-buffer/-/bigint-buffer-1.1.10.tgz#a1d9ca22d3cad1a138b78baaf15543637a3e1692" - integrity sha512-pYIQC5EcMmID74t26GCC67946mgTJFiLXOT/BYozgrd4UEY2JHEGLhWi9cMiQCt5BSqFEvKkCHNnoj82SRjiEw== - dependencies: - node-gyp-build "4.4.0" - -"@trufflesuite/bigint-buffer@1.1.9": - version "1.1.9" - resolved "https://registry.yarnpkg.com/@trufflesuite/bigint-buffer/-/bigint-buffer-1.1.9.tgz#e2604d76e1e4747b74376d68f1312f9944d0d75d" - integrity sha512-bdM5cEGCOhDSwminryHJbRmXc1x7dPKg6Pqns3qyTwFlxsqUgxE29lsERS3PlIW1HTjoIGMUqsk1zQQwST1Yxw== - dependencies: - node-gyp-build "4.3.0" - "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -1731,14 +1486,6 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== -"@typechain/ethers-v5@^10.0.0": - version "10.2.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-10.2.0.tgz#68f5963efb5214cb2d881477228e4b5b315473e1" - integrity sha512-ikaq0N/w9fABM+G01OFmU3U3dNnyRwEahkdvi9mqy1a3XwKiPZaF/lu54OcNaEWnpvEYyhhS0N7buCtLQqC92w== - dependencies: - lodash "^4.17.15" - ts-essentials "^7.0.1" - "@typechain/ethers-v6@^0.4.0": version "0.4.0" resolved "https://registry.yarnpkg.com/@typechain/ethers-v6/-/ethers-v6-0.4.0.tgz#fb9e9b8eeadc455fd1fc9048b2340309860deaca" @@ -1754,11 +1501,6 @@ dependencies: fs-extra "^9.1.0" -"@types/abstract-leveldown@*": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-7.2.1.tgz#bb16403c17754b0c4d5772d71d03b924a03d4c80" - integrity sha512-YK8irIC+eMrrmtGx0H4ISn9GgzLd9dojZWJaMbjp1YHLl2VqqNFBNrL5Q3KjGf4VE3sf/4hmq6EhQZ7kZp1NoQ== - "@types/bn.js@^4.11.3": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" @@ -1815,21 +1557,7 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== -"@types/level-errors@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/level-errors/-/level-errors-3.0.0.tgz#15c1f4915a5ef763b51651b15e90f6dc081b96a8" - integrity sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ== - -"@types/levelup@^4.3.0": - version "4.3.3" - resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.3.tgz#4dc2b77db079b1cf855562ad52321aa4241b8ef4" - integrity sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA== - dependencies: - "@types/abstract-leveldown" "*" - "@types/level-errors" "*" - "@types/node" "*" - -"@types/lru-cache@5.1.1", "@types/lru-cache@^5.1.0": +"@types/lru-cache@^5.1.0": version "5.1.1" resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== @@ -1844,36 +1572,16 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/mkdirp@^0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" - integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== - dependencies: - "@types/node" "*" - "@types/mocha@^10.0.1": version "10.0.1" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.1.tgz#2f4f65bb08bc368ac39c96da7b2f09140b26851b" integrity sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q== -"@types/node-fetch@^2.6.1": - version "2.6.3" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.3.tgz#175d977f5e24d93ad0f57602693c435c57ad7e80" - integrity sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - "@types/node@*", "@types/node@^18.14.6": version "18.16.1" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.1.tgz#5db121e9c5352925bb1f1b892c4ae620e3526799" integrity sha512-DZxSZWXxFfOlx7k7Rv4LAyiMroaxa3Ly/7OOzZO8cBNho0YzAi4qlbrx8W27JGqG57IgR/6J7r+nOJWw6kcvZA== -"@types/node@11.11.6": - version "11.11.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" - integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== - "@types/node@18.15.13": version "18.15.13" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" @@ -1911,11 +1619,6 @@ dependencies: "@types/node" "*" -"@types/seedrandom@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-3.0.1.tgz#1254750a4fec4aff2ebec088ccd0bb02e91fedb4" - integrity sha512-giB9gzDeiCeloIXDgzFBCgjj1k4WxcDrZtGl6h1IqmUPlxF+Nx8Ve+96QCyDZ/HseB/uvDsKbpib9hU5cU53pw== - "@types/semver@^7.3.12": version "7.3.13" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" @@ -2033,40 +1736,6 @@ abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: module-error "^1.0.1" queue-microtask "^1.2.3" -abstract-leveldown@^6.2.1: - version "6.3.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" - integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -abstract-leveldown@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz#08d19d4e26fb5be426f7a57004851b39e1795a2e" - integrity sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ== - dependencies: - buffer "^6.0.3" - catering "^2.0.0" - is-buffer "^2.0.5" - level-concat-iterator "^3.0.0" - level-supports "^2.0.1" - queue-microtask "^1.2.3" - -abstract-leveldown@~6.2.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" - integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -2112,7 +1781,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.6: +ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.6: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -2298,18 +1967,6 @@ arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== -asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== - assertion-error@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" @@ -2332,13 +1989,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-eventemitter@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== - dependencies: - async "^2.4.0" - async-retry@1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" @@ -2346,18 +1996,6 @@ async-retry@1.3.3: dependencies: retry "0.13.1" -async@^2.4.0: - version "2.6.4" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" - integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== - dependencies: - lodash "^4.17.14" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - at-least-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" @@ -2368,16 +2006,6 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== - -aws4@^1.8.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" - integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2395,13 +2023,6 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - bech32@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" @@ -2422,7 +2043,7 @@ bigint-crypto-utils@^3.0.23: resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz#e30a49ec38357c6981cd3da5aaa6480b1f752ee4" integrity sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw== -bignumber.js@^9.0.0, bignumber.js@^9.0.1: +bignumber.js@^9.0.1: version "9.1.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== @@ -2432,16 +2053,6 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bip39@3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" - integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - bl@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-5.1.0.tgz#183715f678c7188ecef9fe475d90209400624273" @@ -2461,7 +2072,7 @@ bn.js@4.11.6: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== -bn.js@^4.0.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.8, bn.js@^4.11.9: +bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -2514,7 +2125,7 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -brorand@^1.0.1, brorand@^1.1.0: +brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== @@ -2587,21 +2198,6 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -buffer-xor@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-2.0.2.tgz#34f7c64f04c777a1f8aac5e661273bb9dd320289" - integrity sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ== - dependencies: - safe-buffer "^5.1.1" - -buffer@^5.5.0, buffer@^5.6.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - buffer@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -2610,13 +2206,6 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -bufferutil@4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" - integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== - dependencies: - node-gyp-build "^4.3.0" - bufio@^1.0.7: version "1.2.0" resolved "https://registry.yarnpkg.com/bufio/-/bufio-1.2.0.tgz#b9ad1c06b0d9010363c387c39d2810a7086d143f" @@ -2716,12 +2305,7 @@ case@^1.6.3: resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== - -catering@^2.0.0, catering@^2.1.0, catering@^2.1.1: +catering@^2.1.0, catering@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== @@ -2949,13 +2533,6 @@ colorette@^2.0.19: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - command-exists@^1.2.8: version "1.2.9" resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" @@ -2991,11 +2568,6 @@ commander@^10.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -commander@^8.1.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -3072,16 +2644,6 @@ cookie@^0.4.1: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== -core-js-pure@^3.0.1: - version "3.30.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.30.1.tgz#7d93dc89e7d47b8ef05d7e79f507b0e99ea77eec" - integrity sha512-nXBEVpmUnNRhz83cHd9JRQC52cTMcuXAmR56+9dSMpRdpeA4I1PX6yjmhd71Eyc/wXNsdBdUDIj1QTIeZpU5Tg== - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -3161,13 +2723,6 @@ dargs@^7.0.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== - dependencies: - assert-plus "^1.0.0" - data-uri-to-buffer@3: version "3.0.1" resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" @@ -3185,20 +2740,6 @@ debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, de dependencies: ms "2.1.2" -debug@^2.2.0: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - decamelize-keys@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.1.tgz#04a2d523b2f18d80d0158a43b895d56dff8d19d8" @@ -3278,14 +2819,6 @@ defer-to-connect@^2.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== -deferred-leveldown@~5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" - integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== - dependencies: - abstract-leveldown "~6.2.1" - inherits "^2.0.3" - define-lazy-prop@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" @@ -3309,11 +2842,6 @@ degenerator@^3.0.2: esprima "^4.0.0" vm2 "^3.9.17" -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - delete-empty@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/delete-empty/-/delete-empty-3.0.0.tgz#f8040f2669f26fa7060bc2304e9859c593b685e8" @@ -3387,14 +2915,6 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - electron-to-chromium@^1.4.284: version "1.4.374" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.374.tgz#091b2de9d80b970f9b5e689675ea62622cd1d74b" @@ -3413,11 +2933,6 @@ elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emittery@0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.0.tgz#bb373c660a9d421bb44706ec4967ed50c02a8026" - integrity sha512-AGvFfs+d0JKCJQ4o01ASQLGPmSCxgfU9RFXvzPvZdjKK8oscynksuJhWrSTSw7j7Ep/sZct5b5ZhYCi8S/t0HQ== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -3428,16 +2943,6 @@ emoji-regex@^9.2.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== -encoding-down@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" - integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== - dependencies: - abstract-leveldown "^6.2.1" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" - enquirer@^2.3.0: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -3450,13 +2955,6 @@ env-paths@^2.2.0: resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== -errno@~0.1.1: - version "0.1.8" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" - integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== - dependencies: - prr "~1.0.1" - error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -3749,19 +3247,7 @@ ethereum-cryptography@^1.0.3: "@scure/bip32" "1.1.5" "@scure/bip39" "1.1.1" -ethereum-waffle@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-4.0.10.tgz#f1ef1564c0155236f1a66c6eae362a5d67c9f64c" - integrity sha512-iw9z1otq7qNkGDNcMoeNeLIATF9yKl1M8AIeu42ElfNBplq0e+5PeasQmm8ybY/elkZ1XyRO0JBQxQdVRb8bqQ== - dependencies: - "@ethereum-waffle/chai" "4.0.10" - "@ethereum-waffle/compiler" "4.0.3" - "@ethereum-waffle/mock-contract" "4.0.4" - "@ethereum-waffle/provider" "4.0.5" - solc "0.8.15" - typechain "^8.0.0" - -ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: +ethereumjs-abi@^0.6.8: version "0.6.8" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== @@ -3769,17 +3255,6 @@ ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: bn.js "^4.11.8" ethereumjs-util "^6.0.0" -ethereumjs-util@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz#b55d7b64dde3e3e45749e4c41288238edec32d23" - integrity sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - rlp "^2.2.4" - ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" @@ -3793,7 +3268,7 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: ethjs-util "0.1.6" rlp "^2.2.3" -ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.3, ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: +ethereumjs-util@^7.1.0: version "7.1.5" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== @@ -3912,11 +3387,6 @@ execa@^5.0.0, execa@^5.1.1: signal-exit "^3.0.3" strip-final-newline "^2.0.0" -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - external-editor@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" @@ -3926,16 +3396,6 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -4094,34 +3554,11 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== - form-data-encoder@^2.1.2: version "2.1.4" resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-2.1.4.tgz#261ea35d2a70d48d30ec7a9603130fa5515e9cd5" integrity sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - formdata-polyfill@^4.0.10: version "4.0.10" resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" @@ -4225,7 +3662,7 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: +functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== @@ -4235,23 +3672,6 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -ganache@7.4.3: - version "7.4.3" - resolved "https://registry.yarnpkg.com/ganache/-/ganache-7.4.3.tgz#e995f1250697264efbb34d4241c374a2b0271415" - integrity sha512-RpEDUiCkqbouyE7+NMXG26ynZ+7sGiODU84Kz+FVoXUnQ4qQM4M8wif3Y4qUCt+D/eM1RVeGq0my62FPD6Y1KA== - dependencies: - "@trufflesuite/bigint-buffer" "1.1.10" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "5.1.1" - "@types/seedrandom" "3.0.1" - emittery "0.10.0" - keccak "3.0.2" - leveldown "6.1.0" - secp256k1 "4.0.3" - optionalDependencies: - bufferutil "4.0.5" - utf-8-validate "5.0.7" - gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -4306,13 +3726,6 @@ get-uri@3: fs-extra "^8.1.0" ftp "^0.3.10" -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== - dependencies: - assert-plus "^1.0.0" - git-raw-commits@^2.0.11: version "2.0.11" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" @@ -4528,19 +3941,6 @@ handlebars@^4.7.7: optionalDependencies: uglify-js "^3.1.4" -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - hard-rejection@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" @@ -4706,7 +4106,7 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: +hosted-git-info@^2.1.4: version "2.8.9" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== @@ -4748,15 +4148,6 @@ http-proxy-agent@^4.0.0, http-proxy-agent@^4.0.1: agent-base "6" debug "4" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - http2-wrapper@^2.1.10: version "2.2.0" resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.2.0.tgz#b80ad199d216b7d3680195077bd7b9060fa9d7f3" @@ -4795,7 +4186,7 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.13, ieee754@^1.2.1: +ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -4805,16 +4196,6 @@ ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== -immediate@^3.2.3: - version "3.3.0" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" - integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== - -immediate@~3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" - integrity sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg== - immutable@^4.0.0-rc.12: version "4.3.0" resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.0.tgz#eb1738f14ffb39fd068b1dbe1296117484dd34be" @@ -5176,7 +4557,7 @@ is-typed-array@^1.1.10, is-typed-array@^1.1.9: gopd "^1.0.1" has-tostringtag "^1.0.0" -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== @@ -5191,11 +4572,6 @@ is-unicode-supported@^1.1.0, is-unicode-supported@^1.2.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz#d824984b616c292a2e198207d4a609983842f714" integrity sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ== -is-url@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" - integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== - is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" @@ -5235,11 +4611,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== - issue-parser@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/issue-parser/-/issue-parser-6.0.0.tgz#b1edd06315d4f2044a9755daf85fdafde9b4014a" @@ -5354,23 +4725,11 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-bigint@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" - integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== - dependencies: - bignumber.js "^9.0.0" - json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -5391,21 +4750,11 @@ json-schema-traverse@^1.0.0: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - json5@^2.2.2: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" @@ -5444,33 +4793,6 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - -keccak@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" - integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -keccak@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" - integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.0" - keccak@^3.0.0, keccak@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" @@ -5506,74 +4828,11 @@ latest-version@^7.0.0: dependencies: package-json "^8.1.0" -level-codec@^9.0.0: - version "9.0.2" - resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" - integrity sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ== - dependencies: - buffer "^5.6.0" - -level-concat-iterator@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-3.1.0.tgz#5235b1f744bc34847ed65a50548aa88d22e881cf" - integrity sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ== - dependencies: - catering "^2.1.0" - -level-concat-iterator@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" - integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== - -level-errors@^2.0.0, level-errors@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.1.tgz#2132a677bf4e679ce029f517c2f17432800c05c8" - integrity sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw== - dependencies: - errno "~0.1.1" - -level-iterator-stream@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" - integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== - dependencies: - inherits "^2.0.4" - readable-stream "^3.4.0" - xtend "^4.0.2" - -level-mem@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-5.0.1.tgz#c345126b74f5b8aa376dc77d36813a177ef8251d" - integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== - dependencies: - level-packager "^5.0.3" - memdown "^5.0.0" - -level-packager@^5.0.3: - version "5.1.1" - resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" - integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== - dependencies: - encoding-down "^6.3.0" - levelup "^4.3.2" - -level-supports@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-2.1.0.tgz#9af908d853597ecd592293b2fad124375be79c5f" - integrity sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA== - level-supports@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== -level-supports@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" - integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== - dependencies: - xtend "^4.0.2" - level-transcoder@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" @@ -5582,15 +4841,6 @@ level-transcoder@^1.0.1: buffer "^6.0.3" module-error "^1.0.1" -level-ws@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-2.0.0.tgz#207a07bcd0164a0ec5d62c304b4615c54436d339" - integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== - dependencies: - inherits "^2.0.3" - readable-stream "^3.1.0" - xtend "^4.0.1" - level@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/level/-/level-8.0.0.tgz#41b4c515dabe28212a3e881b61c161ffead14394" @@ -5599,26 +4849,6 @@ level@^8.0.0: browser-level "^1.0.1" classic-level "^1.2.0" -leveldown@6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-6.1.0.tgz#7ab1297706f70c657d1a72b31b40323aa612b9ee" - integrity sha512-8C7oJDT44JXxh04aSSsfcMI8YiaGRhOFI9/pMEL7nWJLVsWajDPTRxsSHTM2WcTVY5nXM+SuRHzPPi0GbnDX+w== - dependencies: - abstract-leveldown "^7.2.0" - napi-macros "~2.0.0" - node-gyp-build "^4.3.0" - -levelup@^4.3.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" - integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== - dependencies: - deferred-leveldown "~5.3.0" - level-errors "~2.0.0" - level-iterator-stream "~4.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -5780,7 +5010,7 @@ lodash.upperfirst@^4.3.1: resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== -lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.16, lodash@^4.17.21: +lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.16, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5842,11 +5072,6 @@ lru_map@^0.3.3: resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== -ltgt@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" - integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA== - lunr@^2.3.9: version "2.3.9" resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" @@ -5908,18 +5133,6 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -memdown@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" - integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== - dependencies: - abstract-leveldown "~6.2.1" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.2.0" - memory-level@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" @@ -5961,18 +5174,6 @@ merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -merkle-patricia-tree@^4.2.2, merkle-patricia-tree@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz#ff988d045e2bf3dfa2239f7fabe2d59618d57413" - integrity sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w== - dependencies: - "@types/levelup" "^4.3.0" - ethereumjs-util "^7.1.4" - level-mem "^5.0.1" - level-ws "^2.0.0" - readable-stream "^3.6.0" - semaphore-async-await "^1.5.1" - merkletreejs@^0.3.9: version "0.3.10" resolved "https://registry.yarnpkg.com/merkletreejs/-/merkletreejs-0.3.10.tgz#b9abdfc5e3aadaf9eb8b0a35c4b87aea33f5d4b7" @@ -5992,20 +5193,12 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - mime-db@1.52.0: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@2.1.35, mime-types@^2.1.12, mime-types@~2.1.19: +mime-types@2.1.35: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -6089,13 +5282,6 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" @@ -6140,17 +5326,12 @@ module-error@^1.0.1, module-error@^1.0.2: resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.1.1: +ms@2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -6170,11 +5351,6 @@ napi-macros@^2.2.2: resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.2.2.tgz#817fef20c3e0e40a963fbf7b37d1600bd0201044" integrity sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g== -napi-macros@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.0.0.tgz#2b6bae421e7b96eb687aa6c77a7858640670001b" - integrity sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg== - natural-compare-lite@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" @@ -6228,16 +5404,6 @@ node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-gyp-build@4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" - integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== - -node-gyp-build@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" - integrity sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ== - node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: version "4.6.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" @@ -6345,11 +5511,6 @@ nyc@^15.1.0: test-exclude "^6.0.0" yargs "^15.0.2" -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -6609,11 +5770,6 @@ parse-url@^8.1.0: dependencies: parse-path "^7.0.0" -path-browserify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -6659,7 +5815,7 @@ pathval@^1.1.1: resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== -pbkdf2@^3.0.17, pbkdf2@^3.0.9: +pbkdf2@^3.0.17: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -6670,11 +5826,6 @@ pbkdf2@^3.0.17, pbkdf2@^3.0.9: safe-buffer "^5.0.1" sha.js "^2.4.8" -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -6788,22 +5939,7 @@ proxy-from-env@^1.0.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== - -psl@^1.1.28: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== - -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== @@ -6820,16 +5956,6 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== - queue-microtask@^1.2.2, queue-microtask@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -6845,7 +5971,7 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== -randombytes@^2.0.1, randombytes@^2.1.0: +randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -6901,7 +6027,7 @@ readable-stream@1.1.x: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.1.0, readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== @@ -7000,32 +6126,6 @@ release-zalgo@^1.0.0: dependencies: es6-error "^4.0.1" -request@^2.85.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -7139,13 +6239,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rlp@2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" - integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== - dependencies: - bn.js "^4.11.1" - rlp@^2.2.3, rlp@^2.2.4: version "2.2.7" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" @@ -7236,7 +6329,7 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -7246,7 +6339,7 @@ scrypt-js@3.0.1, scrypt-js@^3.0.0: resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== -secp256k1@4.0.3, secp256k1@^4.0.1: +secp256k1@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== @@ -7255,16 +6348,6 @@ secp256k1@4.0.3, secp256k1@^4.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -seedrandom@3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.5.tgz#54edc85c95222525b0c7a6f6b3543d8e0b3aa0a7" - integrity sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg== - -semaphore-async-await@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" - integrity sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg== - semver-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-4.0.0.tgz#3afcf5ed6d62259f5c72d0d5d50dffbdc9680df5" @@ -7444,19 +6527,6 @@ solc@0.7.3: semver "^5.5.0" tmp "0.0.33" -solc@0.8.15: - version "0.8.15" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.15.tgz#d274dca4d5a8b7d3c9295d4cbdc9291ee1c52152" - integrity sha512-Riv0GNHNk/SddN/JyEuFKwbcWcEeho15iyupTSHw5Np6WuXA5D8kEHbyzDHi6sqmvLzu2l+8b1YmL8Ytple+8w== - dependencies: - command-exists "^1.2.8" - commander "^8.1.0" - follow-redirects "^1.12.1" - js-sha3 "0.8.0" - memorystream "^0.3.1" - semver "^5.5.0" - tmp "0.0.33" - solhint@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/solhint/-/solhint-3.4.1.tgz#8ea15b21c13d1be0b53fd46d605a24d0b36a0c46" @@ -7555,21 +6625,6 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - stacktrace-parser@^0.1.10: version "0.1.10" resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" @@ -7840,14 +6895,6 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -7925,23 +6972,11 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - tweetnacl-util@^0.15.1: version "0.15.1" resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" @@ -8011,22 +7046,6 @@ type-fest@^3.0.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-3.9.0.tgz#36a9e46e6583649f9e6098b267bc577275e9e4f4" integrity sha512-hR8JP2e8UiH7SME5JZjsobBlEiatFoxpzCP+R3ZeCo7kAaG1jXQE5X/buLzogM6GJu8le9Y4OcfNuIQX0rZskA== -typechain@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.1.1.tgz#9c2e8012c2c4c586536fc18402dcd7034c4ff0bd" - integrity sha512-uF/sUvnXTOVF2FHKhQYnxHk4su4JjZR8vr4mA2mBaRwHTbwh0jIlqARz9XJr1tA0l7afJGvEa1dTSi4zt039LQ== - dependencies: - "@types/prettier" "^2.1.1" - debug "^4.3.1" - fs-extra "^7.0.0" - glob "7.1.7" - js-sha3 "^0.8.0" - lodash "^4.17.15" - mkdirp "^1.0.4" - prettier "^2.3.1" - ts-command-line-args "^2.2.0" - ts-essentials "^7.0.1" - typechain@^8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.2.0.tgz#bd4fc8f111d4405e36858bae6f744604617b60f3" @@ -8190,21 +7209,6 @@ url-join@5.0.0: resolved "https://registry.yarnpkg.com/url-join/-/url-join-5.0.0.tgz#c2f1e5cbd95fa91082a93b58a1f42fecb4bdbcf1" integrity sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA== -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -utf-8-validate@5.0.7: - version "5.0.7" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" - integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== - dependencies: - node-gyp-build "^4.3.0" - utf8@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" @@ -8215,11 +7219,6 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - uuid@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" @@ -8243,15 +7242,6 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - vm2@^3.9.17: version "3.9.19" resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.19.tgz#be1e1d7a106122c6c492b4d51c2e8b93d3ed6a4a" @@ -8452,11 +7442,6 @@ xregexp@2.0.0: resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" integrity sha512-xl/50/Cf32VsGq/1R8jJE5ajH1yMCQkpmoS10QbFZWl2Oor4H0Me64Pu2yxvsRWK3m6soJbmGfzSR7BYmDcWAA== -xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - y18n@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" From 5a7b1ff4552f3add7344dea97179dee36acb9583 Mon Sep 17 00:00:00 2001 From: perryrare Date: Wed, 12 Jul 2023 13:50:06 -0400 Subject: [PATCH 06/10] fix: Lint issues --- src/__tests__/looksrare/executeTakerAsk.test.ts | 2 +- src/__tests__/looksrare/executeTakerBid.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/__tests__/looksrare/executeTakerAsk.test.ts b/src/__tests__/looksrare/executeTakerAsk.test.ts index 576e8b1..e4759e6 100644 --- a/src/__tests__/looksrare/executeTakerAsk.test.ts +++ b/src/__tests__/looksrare/executeTakerAsk.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { parseEther, utils } from "ethers"; +import { parseEther } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; diff --git a/src/__tests__/looksrare/executeTakerBid.test.ts b/src/__tests__/looksrare/executeTakerBid.test.ts index 48f0367..a5725cb 100644 --- a/src/__tests__/looksrare/executeTakerBid.test.ts +++ b/src/__tests__/looksrare/executeTakerBid.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { parseEther, utils } from "ethers"; +import { parseEther } from "ethers"; import { ethers } from "hardhat"; import { setUpContracts, SetupMocks, getSigners, Signers } from "../helpers/setup"; import { LooksRare } from "../../LooksRare"; From e7e027c5703f73e37537f03f8cfacbd183c1970d Mon Sep 17 00:00:00 2001 From: perryrare Date: Mon, 17 Jul 2023 13:34:07 -0400 Subject: [PATCH 07/10] chore: Feedback --- doc/interfaces/types.ChainInfo.md | 6 ++++++ doc/modules/types.md | 4 ++++ src/__tests__/looksrare/createTaker.test.ts | 4 ++-- src/types.ts | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/interfaces/types.ChainInfo.md b/doc/interfaces/types.ChainInfo.md index 8bbc38e..9f838a9 100644 --- a/doc/interfaces/types.ChainInfo.md +++ b/doc/interfaces/types.ChainInfo.md @@ -57,3 +57,9 @@ ___ ### rpcUrl • **rpcUrl**: `string` + +___ + +### wsUrl + +• **wsUrl**: `string` diff --git a/doc/modules/types.md b/doc/modules/types.md index 51001a9..35612d7 100644 --- a/doc/modules/types.md +++ b/doc/modules/types.md @@ -52,6 +52,10 @@ ___ Ƭ **Signer**: `ethers.Signer` +**`See`** + +[Ethers Signer](https://docs.ethers.org/v6/api/providers/#Signer) + ___ ### SolidityType diff --git a/src/__tests__/looksrare/createTaker.test.ts b/src/__tests__/looksrare/createTaker.test.ts index b57e249..1455678 100644 --- a/src/__tests__/looksrare/createTaker.test.ts +++ b/src/__tests__/looksrare/createTaker.test.ts @@ -62,7 +62,7 @@ describe("Create takers", () => { ); expect(taker.recipient).to.be.equal(signers.user2.address); - expect(Number(BigInt(itemId))).to.be.equal(1); + expect(BigInt(itemId)).to.be.equal(1n); }); it("throw when quote type is wrong", async () => { @@ -95,7 +95,7 @@ describe("Create takers", () => { taker.additionalParameters ); expect(taker.recipient).to.be.equal(signers.user2.address); - expect(Number(BigInt(itemId))).to.be.equal(1); + expect(BigInt(itemId)).to.be.equal(1n); }); it("throw when quote type is wrong", async () => { diff --git a/src/types.ts b/src/types.ts index 4de5850..5be12ac 100644 --- a/src/types.ts +++ b/src/types.ts @@ -83,6 +83,9 @@ export interface BatchTransferItem { amounts: BigNumberish[]; } +/** + * @see {@link https://docs.ethers.org/v6/api/providers/#Signer Ethers Signer} + */ export type Signer = ethers.Signer; /** Return type for any on chain call */ From 528781fcbb7a6e7bd515efcb94c5236b2b4c3427 Mon Sep 17 00:00:00 2001 From: perryrare Date: Thu, 20 Jul 2023 12:19:28 -0400 Subject: [PATCH 08/10] chore: Change to low level provider --- README.md | 12 +++++++++--- doc/classes/LooksRare.LooksRare.md | 8 ++++---- src/LooksRare.ts | 12 ++++++------ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c584188..2c6810d 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,19 @@ const addresses: Addresses = {...}; const looksrare = new LooksRare(ChainId.HARDHAT, provider, signer, addresses); ``` -:information_source: You can access the multicall provider after the instance creation: +:information_source: Use [`JsonRpcProvider`](https://docs.ethers.org/v6/api/providers/jsonrpc/#JsonRpcApiProviderOptions) from `ethers v6` if you want to make batched RPC calls. ```ts -const multicallProvider = looksrare.provider; +import { JsonRpcProvider, Network } from "ethers"; + +// Create a HTTP/HTTPS batch call provider +const provider = new JsonRpcProvider(RPC_URL, CHAIN_ID, { staticNetwork: Network.from(CHAIN_ID) }); + +// Create LooksRare instance using this provider +const looksrare = new LooksRare(ChainId.HARDHAT, provider, signer, addresses); ``` -See [0xsequence doc](https://github.com/0xsequence/sequence.js/tree/master/packages/multicall) to understand how to use it. +Prior to [`@looksrare/sdk-v2@0.9.2`](https://www.npmjs.com/package/@looksrare/sdk-v2/v/0.9.2?activeTab=readme), LooksRareSDK was making batched calls using `0xsequence/multicall`. But this is not natively supported since `@looksrare/sdk-v2@1.0.0`. ## Documentation diff --git a/doc/classes/LooksRare.LooksRare.md b/doc/classes/LooksRare.LooksRare.md index a98d8d3..53dd7a5 100644 --- a/doc/classes/LooksRare.LooksRare.md +++ b/doc/classes/LooksRare.LooksRare.md @@ -18,7 +18,7 @@ LooksRare protocol main class | Name | Type | Description | | :------ | :------ | :------ | | `chainId` | [`ChainId`](../enums/types.ChainId.md) | Current app chain id | -| `provider` | `JsonRpcProvider` | Ethers JsonRpc provider | +| `provider` | `Provider` | Ethers provider | | `signer?` | `Signer` | Ethers signer | | `override?` | [`Addresses`](../interfaces/types.Addresses.md) | Overrides contract addresses for hardhat setup | @@ -42,13 +42,13 @@ ___ ### provider -• `Readonly` **provider**: `JsonRpcProvider` +• `Readonly` **provider**: `Provider` -Ethers JsonRPC provider with batch functionality +Ethers provider. If you want a batch functionality, use JsonRpcProvider. **`See`** -[Ethers providers doc](https://docs.ethers.org/v6/api/providers/jsonrpc/#about-jsonrpcProvider) +[Ethers provider doc](https://docs.ethers.org/v6/api/providers/#Provider) ___ diff --git a/src/LooksRare.ts b/src/LooksRare.ts index c1e290b..c6e613c 100644 --- a/src/LooksRare.ts +++ b/src/LooksRare.ts @@ -1,12 +1,12 @@ import { BigNumberish, ContractTransactionResponse, - JsonRpcProvider, MaxUint256, Overrides, solidityPackedKeccak256, TypedDataDomain, ZeroAddress, + Provider, } from "ethers"; import { MerkleTree as MerkleTreeJS } from "merkletreejs"; import { keccak256 } from "js-sha3"; @@ -75,19 +75,19 @@ export class LooksRare { */ public readonly signer?: Signer; /** - * Ethers JsonRPC provider with batch functionality - * @see {@link https://docs.ethers.org/v6/api/providers/jsonrpc/#about-jsonrpcProvider Ethers providers doc} + * Ethers provider. If you want a batch functionality, use JsonRpcProvider. + * @see {@link https://docs.ethers.org/v6/api/providers/#Provider Ethers provider doc} */ - public readonly provider: JsonRpcProvider; + public readonly provider: Provider; /** * LooksRare protocol main class * @param chainId Current app chain id - * @param provider Ethers JsonRpc provider + * @param provider Ethers provider * @param signer Ethers signer * @param override Overrides contract addresses for hardhat setup */ - constructor(chainId: ChainId, provider: JsonRpcProvider, signer?: Signer, override?: Addresses) { + constructor(chainId: ChainId, provider: Provider, signer?: Signer, override?: Addresses) { this.chainId = chainId; this.addresses = override ?? addressesByNetwork[this.chainId]; this.signer = signer; From 8ea16c0a42fcae35519712476d270474dd761bc3 Mon Sep 17 00:00:00 2001 From: perryrare Date: Thu, 20 Jul 2023 12:22:43 -0400 Subject: [PATCH 09/10] chore: Remove signer type --- doc/modules/types.md | 10 ---------- src/LooksRare.ts | 2 +- src/types.ts | 7 +------ src/utils/calls/exchange.ts | 4 ++-- src/utils/calls/nonces.ts | 4 ++-- src/utils/calls/orderValidator.ts | 4 ++-- src/utils/calls/strategies.ts | 4 ++-- src/utils/calls/tokens.ts | 3 +-- src/utils/calls/transferManager.ts | 4 ++-- src/utils/signMakerOrders.ts | 4 ++-- 10 files changed, 15 insertions(+), 31 deletions(-) diff --git a/doc/modules/types.md b/doc/modules/types.md index 35612d7..a842db9 100644 --- a/doc/modules/types.md +++ b/doc/modules/types.md @@ -48,16 +48,6 @@ EIP712 type data ___ -### Signer - -Ƭ **Signer**: `ethers.Signer` - -**`See`** - -[Ethers Signer](https://docs.ethers.org/v6/api/providers/#Signer) - -___ - ### SolidityType Ƭ **SolidityType**: ``"bool"`` \| ``"address"`` \| ``"uint8"`` \| ``"uint16"`` \| ``"uint112"`` \| ``"uint256"`` \| ``"uint256[]"`` \| ``"bytes"`` \| ``"bytes32"`` \| ``"bytes32[]"`` \| ``"string"`` diff --git a/src/LooksRare.ts b/src/LooksRare.ts index c6e613c..de2383f 100644 --- a/src/LooksRare.ts +++ b/src/LooksRare.ts @@ -7,6 +7,7 @@ import { TypedDataDomain, ZeroAddress, Provider, + Signer, } from "ethers"; import { MerkleTree as MerkleTreeJS } from "merkletreejs"; import { keccak256 } from "js-sha3"; @@ -44,7 +45,6 @@ import { Maker, Taker, ChainId, - Signer, CreateMakerInput, CreateMakerAskOutput, CreateMakerBidOutput, diff --git a/src/types.ts b/src/types.ts index 5be12ac..5bc2fac 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { ethers, BigNumberish, BytesLike, Overrides, TypedDataField, ContractTransactionResponse } from "ethers"; +import { BigNumberish, BytesLike, Overrides, TypedDataField, ContractTransactionResponse } from "ethers"; import { Eip712MakerMerkleTree } from "./utils/Eip712MakerMerkleTree"; /** Addresses used to create a LooksRare instance */ @@ -83,11 +83,6 @@ export interface BatchTransferItem { amounts: BigNumberish[]; } -/** - * @see {@link https://docs.ethers.org/v6/api/providers/#Signer Ethers Signer} - */ -export type Signer = ethers.Signer; - /** Return type for any on chain call */ export interface ContractMethods { call: (additionalOverrides?: Overrides) => Promise; diff --git a/src/utils/calls/exchange.ts b/src/utils/calls/exchange.ts index ba75361..fbe7585 100644 --- a/src/utils/calls/exchange.ts +++ b/src/utils/calls/exchange.ts @@ -1,7 +1,7 @@ -import { Contract, ZeroAddress } from "ethers"; +import { Contract, ZeroAddress, Signer } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abiLooksRareProtocol from "../../abis/LooksRareProtocol.json"; -import { Maker, MerkleTree, Taker, Signer, ContractMethods } from "../../types"; +import { Maker, MerkleTree, Taker, ContractMethods } from "../../types"; import { PayableOverrides } from "../../typechain/common"; export const executeTakerBid = ( diff --git a/src/utils/calls/nonces.ts b/src/utils/calls/nonces.ts index 80ebde2..dba0c0c 100644 --- a/src/utils/calls/nonces.ts +++ b/src/utils/calls/nonces.ts @@ -1,7 +1,7 @@ -import { Contract, Overrides, BigNumberish, Provider } from "ethers"; +import { Contract, Overrides, BigNumberish, Provider, Signer } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abi from "../../abis/LooksRareProtocol.json"; -import { Signer, ContractMethods } from "../../types"; +import { ContractMethods } from "../../types"; export const viewUserBidAskNonces = async ( signerOrProvider: Provider | Signer, diff --git a/src/utils/calls/orderValidator.ts b/src/utils/calls/orderValidator.ts index bc79c4f..01f8af8 100644 --- a/src/utils/calls/orderValidator.ts +++ b/src/utils/calls/orderValidator.ts @@ -1,7 +1,7 @@ -import { Contract, Provider, Overrides } from "ethers"; +import { Contract, Provider, Overrides, Signer } from "ethers"; import { OrderValidatorV2A } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/helpers/OrderValidatorV2A"; import abi from "../../abis/OrderValidatorV2A.json"; -import { Signer, Maker, MerkleTree, OrderValidatorCode } from "../../types"; +import { Maker, MerkleTree, OrderValidatorCode } from "../../types"; export const verifyMakerOrders = async ( signerOrProvider: Provider | Signer, diff --git a/src/utils/calls/strategies.ts b/src/utils/calls/strategies.ts index 935aaa5..bd9f69f 100644 --- a/src/utils/calls/strategies.ts +++ b/src/utils/calls/strategies.ts @@ -1,7 +1,7 @@ -import { Contract, Overrides, Provider } from "ethers"; +import { Contract, Overrides, Provider, Signer } from "ethers"; import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import abi from "../../abis/LooksRareProtocol.json"; -import { Signer, StrategyType, StrategyInfo } from "../../types"; +import { StrategyType, StrategyInfo } from "../../types"; export const strategyInfo = async ( signerOrProvider: Provider | Signer, diff --git a/src/utils/calls/tokens.ts b/src/utils/calls/tokens.ts index 93870f2..50c73a0 100644 --- a/src/utils/calls/tokens.ts +++ b/src/utils/calls/tokens.ts @@ -1,9 +1,8 @@ -import { Contract, Provider, Overrides, ContractTransactionResponse } from "ethers"; +import { Contract, Provider, Overrides, ContractTransactionResponse, Signer } from "ethers"; import { ERC721 } from "../../typechain/solmate/src/tokens/ERC721.sol/ERC721"; import { ERC20 } from "../../typechain/solmate/src/tokens/ERC20"; import abiIERC721 from "../../abis/IERC721.json"; import abiIERC20 from "../../abis/IERC20.json"; -import { Signer } from "../../types"; // ER721 and ERC1155 diff --git a/src/utils/calls/transferManager.ts b/src/utils/calls/transferManager.ts index 113f0c0..2e5cd85 100644 --- a/src/utils/calls/transferManager.ts +++ b/src/utils/calls/transferManager.ts @@ -1,7 +1,7 @@ -import { Contract, Overrides, Provider } from "ethers"; +import { Contract, Overrides, Provider, Signer } from "ethers"; import { TransferManager } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/TransferManager"; import abi from "../../abis/TransferManager.json"; -import { Signer, ContractMethods, BatchTransferItem } from "../../types"; +import { ContractMethods, BatchTransferItem } from "../../types"; export const hasUserApprovedOperator = async ( signerOrProvider: Provider | Signer, diff --git a/src/utils/signMakerOrders.ts b/src/utils/signMakerOrders.ts index e1fcbd0..80f659e 100644 --- a/src/utils/signMakerOrders.ts +++ b/src/utils/signMakerOrders.ts @@ -1,7 +1,7 @@ -import { ethers, TypedDataDomain } from "ethers"; +import { ethers, TypedDataDomain, Signer } from "ethers"; import { Eip712MakerMerkleTree } from "./Eip712MakerMerkleTree"; import { makerTypes } from "./eip712"; -import { Maker, MerkleTree, Signer, SignMerkleTreeOrdersOutput } from "../types"; +import { Maker, MerkleTree, SignMerkleTreeOrdersOutput } from "../types"; /** * Sign a maker order From 58d59b3b969d625992ecf491bd2ae3c472386906 Mon Sep 17 00:00:00 2001 From: perryrare Date: Tue, 25 Jul 2023 11:30:27 -0400 Subject: [PATCH 10/10] chore: Upgrade to @nomicfoundation/hardhat-ethers --- hardhat.config.ts | 2 +- package.json | 2 +- src/__tests__/helpers/setup.ts | 2 +- yarn.lock | 18 +++++++++++++----- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 129c140..6e84a70 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,4 +1,4 @@ -import "@nomiclabs/hardhat-ethers"; +import "@nomicfoundation/hardhat-ethers"; import "@typechain/hardhat"; import "hardhat-abi-exporter"; diff --git a/package.json b/package.json index 4ffb9b2..2027b9c 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@istanbuljs/nyc-config-typescript": "^1.0.2", "@looksrare/contracts-exchange-v1": "^1.2.0", "@looksrare/contracts-exchange-v2": "^0.1.2", - "@nomiclabs/hardhat-ethers": "3.0.0-beta.0", + "@nomicfoundation/hardhat-ethers": "^3.0.4", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-typescript": "^11.0.0", "@typechain/ethers-v6": "^0.4.0", diff --git a/src/__tests__/helpers/setup.ts b/src/__tests__/helpers/setup.ts index 1a46d90..aa2140e 100644 --- a/src/__tests__/helpers/setup.ts +++ b/src/__tests__/helpers/setup.ts @@ -3,7 +3,7 @@ import { ContractTransactionResponse, ZeroAddress, parseEther } from "ethers"; import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import { ethers } from "hardhat"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { Addresses } from "../../types"; import type { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import type { TransferManager } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/TransferManager"; diff --git a/yarn.lock b/yarn.lock index e52d9f9..cf0ab91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1120,6 +1120,14 @@ mcl-wasm "^0.7.1" rustbn.js "~0.2.0" +"@nomicfoundation/hardhat-ethers@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.4.tgz#6f0df2424e687e26d6574610de7a36bd69485cc1" + integrity sha512-k9qbLoY7qn6C6Y1LI0gk2kyHXil2Tauj4kGzQ8pgxYXIGw8lWn8tuuL72E11CrlKaXRUvOgF0EXrv/msPI2SbA== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" @@ -1186,11 +1194,6 @@ "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" -"@nomiclabs/hardhat-ethers@3.0.0-beta.0": - version "3.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-3.0.0-beta.0.tgz#0ab529b9977e8354dd8e29d750f9cb5109948d5e" - integrity sha512-oV0PZ+UPFiLjV2wVKxYP/OXCJhcqGMTvoVQG2di4EE/2pqgEGDGXdPNfDiRemv6UfK8aGvtvsmU+hM+OrPR7fQ== - "@octokit/auth-token@^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.3.tgz#ce7e48a3166731f26068d7a7a7996b5da58cbe0c" @@ -4950,6 +4953,11 @@ lodash.flattendeep@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ== +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.isfunction@^3.0.9: version "3.0.9" resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051"