-
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.
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// import { ethers } from 'hardhat'; | ||
// import * as dotenv from "dotenv"; | ||
// import { ERC725YDataKeys } from "@lukso/lsp-smart-contracts"; | ||
|
||
// // Load the environment variables | ||
// dotenv.config(); | ||
|
||
// async function attachAssetMetadata(myAssetAddress: string) { | ||
// // Setup the provider | ||
// const provider = new ethers.JsonRpcProvider( | ||
// "https://rpc.testnet.lukso.gateway.fm", | ||
// ); | ||
|
||
// // Setup the controller used to sign the deployment | ||
// const [signer] = await ethers.getSigners(); | ||
// console.log( | ||
// "Updating metadata with Universal Profile Controller: ", | ||
// signer.address, | ||
// ); | ||
|
||
// // Load the Universal Profile | ||
// const universalProfile = await ethers.getContractAtFromArtifact( | ||
// TODO:, | ||
// process.env.UP_ADDR as string, | ||
// ); | ||
|
||
// // Set up the token contract | ||
// const token = new ethers.Contract( | ||
// myAssetAddress, | ||
// TODO:, | ||
// signer, | ||
// ); | ||
|
||
// const metadataKey = ERC725YDataKeys.LSP4["LSP4Metadata"]; | ||
|
||
// // Read the current token metadata | ||
// const currentMetadata = await token.getData(metadataKey); | ||
// console.log( | ||
// "Current token metadata:", | ||
// JSON.stringify(currentMetadata, undefined, 2), | ||
// ); | ||
|
||
// // Create the transaction payload for the contract call | ||
// const setDataPayload = token.interface.encodeFunctionData("setData", [ | ||
// metadataKey, | ||
// ethers.utils.toUtf8Bytes(TODO:), | ||
// ]); | ||
|
||
// // Update the token metadata | ||
// const tx = await universalProfile.connect(signer).getFunction("execute")( | ||
// 0, // Operation type: CALL | ||
// myAssetAddress, | ||
// 0, // Value is empty | ||
// setDataPayload, | ||
// ); | ||
|
||
// // Wait for the transaction to be included in a block | ||
// const receipt = await tx.wait(); | ||
// console.log("Token metadata updated:", receipt); | ||
// } | ||
|
||
// attachAssetMetadata(CustomTokenAddress) | ||
// .then(() => process.exit(0)) | ||
// .catch((error) => { | ||
// console.error(error); | ||
// process.exit(1); | ||
// }); |