-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from lukso-network/more-improvements
More improvements
- Loading branch information
Showing
18 changed files
with
149 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
import { ERC725 } from '@erc725/erc725.js'; | ||
import lsp4Schema from '@erc725/erc725.js/schemas/LSP4DigitalAsset.json'; | ||
|
||
// 💡 Note: You can debug any smart contract by using the ERC725 Tools | ||
// 👉 https://erc725-inspect.lukso.tech/inspector?address=0x86e817172b5c07f7036bf8aa46e2db9063743a83&network=mainnet | ||
const assetContractAddress = '0x86e817172b5c07f7036bf8aa46e2db9063743a83'; | ||
|
||
// Initatiate erc725.js | ||
const erc725js = new ERC725( | ||
lsp4Schema, | ||
'0x6395b330F063F96579aA8F7b59f2584fb9b6c3a5', | ||
'https://rpc.testnet.lukso.gateway.fm', | ||
assetContractAddress, | ||
'https://rpc.lukso.gateway.fm', | ||
{}, | ||
); | ||
|
||
// Fetch the supported storage standard | ||
let isLSP4 = false; | ||
|
||
// Verify if the standard is supported (value !== null) | ||
// 📚 https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata#supportedstandardslsp4digitalasset | ||
const data = await erc725js.getData('SupportedStandards:LSP4DigitalAsset'); | ||
if (data.value !== null) { | ||
isLSP4 = true; | ||
} | ||
|
||
console.log(isLSP4); | ||
const isLSP4 = data.value !== null; | ||
|
||
/* | ||
Supported schemas from erc725.js library: | ||
LSP1UniversalReceiverDelegate LSP3ProfileMetadata | ||
LSP4DigitalAsset LSP5ReceivedAssets | ||
LSP6KeyManager LSP8IdentifiableDigitalAsset | ||
LSP9Vault LSP10ReceivedVaults | ||
LSP12IssuedAssets LSP17ContractExtension | ||
All fetchable keys can be found within @erc725/erc725.js/schemas/[schema].json | ||
*/ | ||
if (isLSP4) { | ||
console.log( | ||
`✅ The contract: ${assetContractAddress} supports the LSP4DigitalAsset standard`, | ||
); | ||
} else { | ||
console.log( | ||
`❌ The address: ${assetContractAddress} does not supports the LSP4DigitalAsset standard`, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
import { ERC725 } from '@erc725/erc725.js'; | ||
import lsp3ProfileSchema from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json'; | ||
|
||
// 💡 Note: You can debug any smart contract by using the ERC725 Tools | ||
// 👉 https://erc725-inspect.lukso.tech/inspector?address=0x9139def55c73c12bcda9c44f12326686e3948634&network=testnet | ||
|
||
const profileContractAddress = '0x9139def55c73c12bcda9c44f12326686e3948634'; | ||
|
||
// Initatiate erc725.js | ||
const erc725js = new ERC725( | ||
lsp3ProfileSchema, | ||
'0x9139def55c73c12bcda9c44f12326686e3948634', | ||
profileContractAddress, | ||
'https://rpc.testnet.lukso.gateway.fm', | ||
{}, | ||
); | ||
|
||
// Fetch the supported storage standard | ||
let isLSP3 = false; | ||
|
||
// Verify if the standard is supported (value !== null) | ||
// 📚 https://docs.lukso.tech/standards/universal-profile/lsp3-profile-metadata/#supportedstandardslsp3profile | ||
const data = await erc725js.getData('SupportedStandards:LSP3Profile'); | ||
if (data.value !== null) { | ||
isLSP3 = true; | ||
} | ||
const isLSP3 = data.value !== null; | ||
|
||
console.log(isLSP3); | ||
|
||
/* | ||
Supported schemas from erc725.js library: | ||
LSP1UniversalReceiverDelegate LSP3ProfileMetadata | ||
LSP4DigitalAsset LSP5ReceivedAssets | ||
LSP6KeyManager LSP8IdentifiableDigitalAsset | ||
LSP9Vault LSP10ReceivedVaults | ||
LSP12IssuedAssets LSP17ContractExtension | ||
All fetchable keys can be found within @erc725/erc725.js/schemas/[schema].json | ||
*/ | ||
if (isLSP3) { | ||
console.log( | ||
`✅ The contract: ${profileContractAddress} supports the LSP3Profile standard`, | ||
); | ||
} else { | ||
console.log( | ||
`❌ The address: ${profileContractAddress} does not supports the LSP3Profile standard`, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
import { ERC725 } from '@erc725/erc725.js'; | ||
import lsp9VaultSchema from '@erc725/erc725.js/schemas/LSP9Vault.json'; | ||
|
||
// 📚 https://docs.lukso.tech/learn/dapp-developer/standard-detection/#metadata-detection | ||
|
||
// TODO: this is an old vault and its interface ID is not correct | ||
const vaultContractAddress = '0x9139def55c73c12bcda9c44f12326686e3948634'; | ||
|
||
// Initatiate erc725.js | ||
const erc725js = new ERC725( | ||
lsp9VaultSchema, | ||
'0x9139def55c73c12bcda9c44f12326686e3948634', | ||
vaultContractAddress, | ||
'https://rpc.testnet.lukso.gateway.fm', | ||
{}, | ||
); | ||
|
||
// Fetch the supported storage standard | ||
let isLSP9 = false; | ||
|
||
// Verify if the standard is supported (value !== null) | ||
const data = await erc725js.getData('SupportedStandards:LSP9Vault'); | ||
if (data.value !== null) { | ||
isLSP9 = true; | ||
} | ||
const isLSP9 = data.value !== null; | ||
|
||
console.log(isLSP9); | ||
|
||
/* | ||
Supported schemas from erc725.js library: | ||
LSP1UniversalReceiverDelegate LSP3ProfileMetadata | ||
LSP4DigitalAsset LSP5ReceivedAssets | ||
LSP6KeyManager LSP8IdentifiableDigitalAsset | ||
LSP9Vault LSP10ReceivedVaults | ||
LSP12IssuedAssets LSP17ContractExtension | ||
All fetchable keys can be found within @erc725/erc725.js/schemas/[schema].json | ||
*/ | ||
if (isLSP9) { | ||
console.log( | ||
`✅ The contract: ${vaultContractAddress} supports the LSP9Vault standard`, | ||
); | ||
} else { | ||
console.log( | ||
`❌ The address: ${vaultContractAddress} does not supports the LSP9Vault standard`, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.