diff --git a/packages/lib/smart-account/src/lukso/index.ts b/packages/lib/smart-account/src/lukso/index.ts index ab36d738d..ce2e03aba 100644 --- a/packages/lib/smart-account/src/lukso/index.ts +++ b/packages/lib/smart-account/src/lukso/index.ts @@ -1,3 +1 @@ -import ERC725ABI from './ERC725ABI.json'; export { LuksoKeyStore } from './LuksoKeyStore'; -export { ERC725ABI }; diff --git a/packages/lib/smart-account/src/lukso/ERC725Abi.json b/packages/messenger-widget/src/hooks/auth/lukso/ERC725Abi.json similarity index 100% rename from packages/lib/smart-account/src/lukso/ERC725Abi.json rename to packages/messenger-widget/src/hooks/auth/lukso/ERC725Abi.json diff --git a/packages/messenger-widget/src/hooks/auth/lukso/LuksoConnector.ts b/packages/messenger-widget/src/hooks/auth/lukso/LuksoConnector.ts index 77075390c..c59cf5143 100644 --- a/packages/messenger-widget/src/hooks/auth/lukso/LuksoConnector.ts +++ b/packages/messenger-widget/src/hooks/auth/lukso/LuksoConnector.ts @@ -2,6 +2,7 @@ import { Lukso } from '@dm3-org/dm3-lib-smart-account'; import { ethers } from 'ethers'; import { DM3Configuration } from '../../../interfaces/config'; import { SmartAccountConnector } from './SmartAccountConnector'; +import ERC725Abi from './ERC725Abi.json'; declare global { interface Window { @@ -30,7 +31,7 @@ export class LuksoConnector { //Instance of the UP contract const upContract = new ethers.Contract( upAddress, - Lukso.ERC725ABI, + ERC725Abi, upController, ); const keyStore = new Lukso.LuksoKeyStore(upContract); diff --git a/packages/messenger-widget/src/hooks/auth/lukso/SmartAccountConnector.test.ts b/packages/messenger-widget/src/hooks/auth/lukso/SmartAccountConnector.test.ts index 6aea57fff..c7536a013 100644 --- a/packages/messenger-widget/src/hooks/auth/lukso/SmartAccountConnector.test.ts +++ b/packages/messenger-widget/src/hooks/auth/lukso/SmartAccountConnector.test.ts @@ -3,6 +3,8 @@ import { Lukso, Constants } from '@dm3-org/dm3-lib-smart-account'; import { mockUserProfile } from '@dm3-org/dm3-lib-test-helper'; import { ethers } from 'ethers'; import { SmartAccountConnector, Success } from './SmartAccountConnector'; +import ERC725Abi from './ERC725Abi.json'; +import { ERC725ABI } from '@dm3-org/dm3-lib-smart-account/dist/lukso'; describe('SmartAccountConnector', () => { describe('SignUp', () => { @@ -18,7 +20,7 @@ describe('SmartAccountConnector', () => { const c = new ethers.Contract( ethers.Wallet.createRandom().address, - Lukso.ERC725ABI, + ERC725Abi, upController1, ); diff --git a/packages/offchain-resolver/package.json b/packages/offchain-resolver/package.json index 54cb7621b..a5f2249be 100644 --- a/packages/offchain-resolver/package.json +++ b/packages/offchain-resolver/package.json @@ -8,6 +8,7 @@ "@dm3-org/dm3-lib-crypto": "workspace:^", "@dm3-org/dm3-lib-profile": "workspace:^", "@dm3-org/dm3-lib-shared": "workspace:^", + "@dm3-org/dm3-lib-smart-account": "workspace:^", "@dm3-org/dm3-lib-test-helper": "workspace:^", "@erc725/erc725.js": "^0.27.1", "@prisma/client": "^4.15.0", diff --git a/packages/offchain-resolver/src/http/profileValidator/ProfileValidator.ts b/packages/offchain-resolver/src/http/profileValidator/ProfileValidator.ts index 4603ed754..0fc530a82 100644 --- a/packages/offchain-resolver/src/http/profileValidator/ProfileValidator.ts +++ b/packages/offchain-resolver/src/http/profileValidator/ProfileValidator.ts @@ -2,7 +2,6 @@ //It supports //1. Profiles signed by an EOA //2. Profiles signed by an Lukso Universal profile -import abiJson from './ERC725Abi.json'; import { checkUserProfileWithAddress, @@ -11,6 +10,7 @@ import { } from '@dm3-org/dm3-lib-profile'; import { stringify } from '@dm3-org/dm3-lib-shared'; import { ethers } from 'ethers'; +import ERC725Abi from './ERC725Abi.json'; //ERC-1271 constants can be found at lsp6-contracts/contracts/constants.sol const ERC1271_SUCCESSVALUE = '0x1626ba7e'; @@ -36,7 +36,7 @@ export class ProfileValidator { ) { const upContract = new ethers.Contract( address, - abiJson, + ERC725Abi, this.luksoProvider, ); //Get the message that the up users has signed earlier to create their profile diff --git a/yarn.lock b/yarn.lock index 7a848d378..0c9968af6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2513,6 +2513,7 @@ __metadata: "@dm3-org/dm3-lib-crypto": "workspace:^" "@dm3-org/dm3-lib-profile": "workspace:^" "@dm3-org/dm3-lib-shared": "workspace:^" + "@dm3-org/dm3-lib-smart-account": "workspace:^" "@dm3-org/dm3-lib-test-helper": "workspace:^" "@erc725/erc725.js": ^0.27.1 "@istanbuljs/nyc-config-typescript": ^1.0.2