Skip to content

Commit

Permalink
chore: upgrade lsp-smart-contracts to v0.15.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Mar 25, 2024
1 parent 664d41c commit 88a5514
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 200 deletions.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
"dependencies": {
"@erc725/erc725.js": "0.22.0",
"@lukso/lsp-factory.js": "3.2.1",
"@lukso/lsp-smart-contracts": "0.14.0",
"@lukso/lsp0-contracts": "^0.15.0-rc.1",
"@lukso/lsp3-contracts": "^0.15.0-rc.1",
"@lukso/lsp6-contracts": "^0.15.0-rc.1",
"@lukso/lsp7-contracts": "^0.15.0-rc.1",
"@lukso/lsp8-contracts": "^0.15.0-rc.1",
"@lukso/lsp9-contracts": "^0.15.0-rc.1",
"@lukso/web3-onboard-config": "1.1.2",
"@pinata/sdk": "^2.1.0",
"@tsndr/cloudflare-worker-jwt": "^2.3.2",
Expand Down Expand Up @@ -48,7 +53,7 @@
},
"devDependencies": {
"@depay/web3-mock": "^14.17.0",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/user-event": "14.4.3",
"@testing-library/vue": "7.0.0",
"@types/jest": "28.1.8",
Expand Down
2 changes: 1 addition & 1 deletion src/components/endpoints/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CustomSelect from '@/components/shared/CustomSelect.vue'
import { useLspFactory } from '@/compositions/useLspFactory'
import { addTokenToLocalStore, recalculateAssets } from '@/helpers/tokenUtils'
import { useERC20 } from '@/compositions/useErc20'
import { LSP8_TOKEN_ID_FORMAT } from '@lukso/lsp-smart-contracts'
import { LSP8_TOKEN_ID_FORMAT } from '@lukso/lsp8-contracts'
const { notification, clearNotification, hasNotification, setNotification } =
useNotifications()
Expand Down
6 changes: 3 additions & 3 deletions src/components/endpoints/Mint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { getState } from '@/stores'
import { onMounted, ref, watchEffect } from 'vue'
import { Contract } from 'web3-eth-contract'
import useNotifications from '@/compositions/useNotifications'
import LSP7Mintable from '@lukso/lsp-smart-contracts/artifacts/LSP7Mintable.json'
import LSP8Mintable from '@lukso/lsp-smart-contracts/artifacts/LSP8Mintable.json'
import LSP7Mintable from '@lukso/lsp7-contracts/artifacts/LSP7Mintable.json'
import LSP8Mintable from '@lukso/lsp8-contracts/artifacts/LSP8Mintable.json'
import Notifications from '@/components/Notification.vue'
import { toWei } from 'web3-utils'
import { ERC725, ERC725JSONSchema } from '@erc725/erc725.js'
Expand All @@ -27,7 +27,7 @@ import useErc725 from '@/compositions/useErc725'
import LSP8IdentifiableDigitalAsset from '@erc725/erc725.js/schemas/LSP8IdentifiableDigitalAsset.json'
import { isHex } from 'web3-utils'
import { isAddress } from 'ethers/lib/utils'
import { LSP8_TOKEN_ID_FORMAT } from '@lukso/lsp-smart-contracts'
import { LSP8_TOKEN_ID_FORMAT } from '@lukso/lsp8-contracts'
import { uploadAssetData } from '@/utils/uploadAssetData'
const { notification, clearNotification, hasNotification, setNotification } =
Expand Down
6 changes: 3 additions & 3 deletions src/components/endpoints/Permissions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { getState } from '@/stores'
import Notifications from '@/components/Notification.vue'
import useNotifications from '@/compositions/useNotifications'
import {
ERC725YDataKeys,
LSP6DataKeys,
ALL_PERMISSIONS,
PERMISSIONS,
// @ts-ignore
} from '@lukso/lsp-smart-contracts'
} from '@lukso/lsp6-contracts'
import { Permissions } from '@erc725/erc725.js/build/main/src/types/Method'
import { computed, ref } from 'vue'
Expand Down Expand Up @@ -60,7 +60,7 @@ const setPermissions = async () => {
const erc725AccountAddress = getState('address')
const key =
ERC725YDataKeys['LSP6']['AddressPermissions:Permissions'] +
LSP6DataKeys['AddressPermissions:Permissions'] +
grantPermissionAddress.value.slice(2)
const value = encodePermissions(selectedPermissions.value)
Expand Down
4 changes: 2 additions & 2 deletions src/components/endpoints/Transfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { getState } from '@/stores'
import { ref } from 'vue'
import { Contract } from 'web3-eth-contract'
import useNotifications from '@/compositions/useNotifications'
import LSP7Mintable from '@lukso/lsp-smart-contracts/artifacts/LSP7Mintable.json'
import LSP8Mintable from '@lukso/lsp-smart-contracts/artifacts/LSP8Mintable.json'
import LSP7Mintable from '@lukso/lsp7-contracts/artifacts/LSP7Mintable.json'
import LSP8Mintable from '@lukso/lsp8-contracts/artifacts/LSP8Mintable.json'
import Notifications from '@/components/Notification.vue'
import { toWei } from 'web3-utils'
import { ContractStandard } from '@/enums'
Expand Down
14 changes: 8 additions & 6 deletions src/helpers/tokenUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import BN from 'bn.js'
import ERC725, { ERC725JSONSchema } from '@erc725/erc725.js'
import { INTERFACE_IDS } from '@lukso/lsp-smart-contracts'
import { INTERFACE_ID_LSP0ERC725Account } from '@lukso/lsp0-contracts'
import { INTERFACE_ID_LSP7 } from '@lukso/lsp7-contracts'
import { INTERFACE_ID_LSP8, LSP8_TOKEN_ID_FORMAT } from '@lukso/lsp8-contracts'
import { INTERFACE_ID_LSP9 } from '@lukso/lsp9-contracts'
import LSP3ProfileMetadata from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json'
import LSP4DigitalAsset from '@erc725/erc725.js/schemas/LSP4DigitalAsset.json'
import LSP9Vault from '@erc725/erc725.js/schemas/LSP9Vault.json'
Expand All @@ -11,7 +14,6 @@ import { store, setState } from '@/stores/index'
import { getSelectedNetworkConfig } from '@/helpers/config'
import useWeb3Connection from '@/compositions/useWeb3Connection'
import { rightPad, fromUtf8, leftPad } from 'web3-utils'
import { LSP8_TOKEN_ID_FORMAT } from '@lukso/lsp-smart-contracts'
import { LSP4MetadataUrlForEncoding } from '@lukso/lsp-factory.js/build/main/src/lib/interfaces/lsp4-digital-asset'

const { lsp7TokenDivisible, lsp7TokenNonDivisible } = getSelectedNetworkConfig()
Expand Down Expand Up @@ -58,25 +60,25 @@ export const lspTypeOptions: Record<
LspTypeOption
> = {
[LSPType.LSP3UniversalProfileMetadata]: {
interfaceId: INTERFACE_IDS.LSP0ERC725Account,
interfaceId: INTERFACE_ID_LSP0ERC725Account,
lsp2Schema: getSupportedStandardObject(
LSP3ProfileMetadata as ERC725JSONSchema[]
),
},
[LSPType.LSP7DigitalAsset]: {
interfaceId: INTERFACE_IDS.LSP7DigitalAsset,
interfaceId: INTERFACE_ID_LSP7,
lsp2Schema: getSupportedStandardObject(
LSP4DigitalAsset as ERC725JSONSchema[]
),
},
[LSPType.LSP8IdentifiableDigitalAsset]: {
interfaceId: INTERFACE_IDS.LSP8IdentifiableDigitalAsset,
interfaceId: INTERFACE_ID_LSP8,
lsp2Schema: getSupportedStandardObject(
LSP4DigitalAsset as ERC725JSONSchema[]
),
},
[LSPType.LSP9Vault]: {
interfaceId: INTERFACE_IDS.LSP9Vault,
interfaceId: INTERFACE_ID_LSP9,
lsp2Schema: getSupportedStandardObject(LSP9Vault as ERC725JSONSchema[]),
},
[LSPType.EoA]: {
Expand Down
6 changes: 3 additions & 3 deletions src/stores/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { reactive } from 'vue'
import { Store, Channel } from '@/types'
import { MEANS_OF_CONNECTION } from '@/helpers/config'
import UniversalProfile from '@lukso/lsp-smart-contracts/artifacts/UniversalProfile.json'
import KeyManager from '@lukso/lsp-smart-contracts/artifacts/LSP6KeyManager.json'
import LSP0ERC725Account from '@lukso/lsp0-contracts/artifacts/LSP0ERC725Account.json'
import KeyManager from '@lukso/lsp6-contracts/artifacts/LSP6KeyManager.json'
import { recalculateAssets } from '@/helpers/tokenUtils'
import useWeb3Connection from '@/compositions/useWeb3Connection'

Expand Down Expand Up @@ -42,7 +42,7 @@ export function useState() {

localStorage.setItem(MEANS_OF_CONNECTION, channel)

window.erc725Account = contract(UniversalProfile.abi as any, address)
window.erc725Account = contract(LSP0ERC725Account.abi as any, address)

try {
const upOwner = await window.erc725Account.methods.owner().call()
Expand Down
2 changes: 1 addition & 1 deletion src/views/profile/Deploy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
DeploymentType,
} from '@lukso/lsp-factory.js'
import { getAndPrepareAllIpfsItems } from '@/helpers/localstorage'
import { LSP3ProfileMetadataJSON } from '@lukso/lsp-smart-contracts'
import { LSP3ProfileMetadataJSON } from '@lukso/lsp3-contracts'
const { notification, clearNotification, hasNotification, setNotification } =
useNotifications()
Expand Down
Loading

0 comments on commit 88a5514

Please sign in to comment.