Skip to content

Commit

Permalink
fix: error in ethers version 5 compatibility code
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadyAkhtar authored Jan 3, 2025
1 parent 352009f commit 12498eb
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"name": "@tradetrust-tt/token-registry",
"version": "5.0.0",
"version": "5.1.1",
"release": {
"branches": [
{ "name": "master" },
{ "name": "v4", "range": "4.x.x" }
{
"name": "master"
},
{
"name": "v4",
"range": "4.x.x"
}
],
"tagFormat": "v${version}"
},
Expand Down
4 changes: 3 additions & 1 deletion src/constants/default-address.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ethers } from "ethers";
import { ethers as packedEthers } from "ethers";

const ethers = { ...packedEthers };

if (ethers.version.includes("/5")) {
(ethers as any).ZeroAddress = (ethers as any)?.constants?.AddressZero;
Expand Down
4 changes: 3 additions & 1 deletion src/constants/role-hash.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ethers } from "ethers";
import { ethers as packedEthers } from "ethers";

const ethers = { ...packedEthers };

if (ethers.version.includes("/5")) {
(ethers as any).id = (ethers as any).utils.id;
Expand Down
4 changes: 3 additions & 1 deletion src/utils/compute-interface-id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ethers } from "ethers";
import { ethers as packedEthers } from "ethers";

const ethers = { ...packedEthers };

if (ethers.version.includes("/5")) {
(ethers as any).id = (ethers as any).utils.id;
Expand Down
4 changes: 3 additions & 1 deletion src/utils/compute-title-escrow-address.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ethers } from "ethers";
import { ethers as packedEthers } from "ethers";

interface Params {
implementationAddress: string;
Expand All @@ -7,6 +7,8 @@ interface Params {
tokenId: string;
}

const ethers = { ...packedEthers };

if (ethers.version.includes("/5")) {
(ethers as any).keccak256 = (ethers as any).utils.keccak256;
(ethers as any).solidityPackedKeccak256 = (ethers as any).utils.solidityKeccak256;
Expand Down
4 changes: 3 additions & 1 deletion src/utils/encode-init-params.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ethers } from "ethers";
import { ethers as packedEthers } from "ethers";

const ethers = { ...packedEthers };

export interface Params {
name: string;
Expand Down
4 changes: 3 additions & 1 deletion src/utils/get-event-from-receipt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ethers } from "ethers";
import { ethers as packedEthers } from "ethers";

const ethers = { ...packedEthers };

if (ethers.version.includes("/5")) {
(ethers as any).Interface = (ethers as any).utils.Interface;
Expand Down

0 comments on commit 12498eb

Please sign in to comment.