diff --git a/scripts/mint.js b/scripts/mint.js new file mode 100644 index 0000000..c39aa55 --- /dev/null +++ b/scripts/mint.js @@ -0,0 +1,26 @@ +require('dotenv').config(); + +// TODO: make this arguments +const contractAddress = '0x91A425C1CA320A99a09BE1bee114Fce5d30153d9'; +const params = [ + '0x7ED735b7095C05d78dF169F991f2b7f1A1F1A049', // to + 'Fleek App', // name + 'Description', // description + 'https://fleek.network/fleek-network-logo-minimal.png', // image + 'https://fleek.co/', // external url + 'fleek.eth', // ens + '6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash + 'https://github.com/org/repo', // repo + 'fleek', // author +]; + +(async () => { + const contract = await hre.ethers.getContractAt( + 'FleekERC721', + contractAddress + ); + + const transaction = await contract.mint(...params); + + console.log('Response: ', transaction); +})(); diff --git a/scripts/tokenURI.js b/scripts/tokenURI.js new file mode 100644 index 0000000..b749095 --- /dev/null +++ b/scripts/tokenURI.js @@ -0,0 +1,20 @@ +require('dotenv').config(); + +// TODO: make this arguments +const contractAddress = '0x91A425C1CA320A99a09BE1bee114Fce5d30153d9'; +const tokenId = 3; + +(async () => { + const contract = await hre.ethers.getContractAt( + 'FleekERC721', + contractAddress + ); + + const transaction = await contract.tokenURI(tokenId); + + const parsed = JSON.parse( + Buffer.from(transaction.slice(29), 'base64').toString('utf-8') + ); + + console.log('Response: ', parsed); +})(); diff --git a/scripts/upgrade.js b/scripts/upgrade.js new file mode 100644 index 0000000..e89e6f4 --- /dev/null +++ b/scripts/upgrade.js @@ -0,0 +1,21 @@ +require('dotenv').config(); + +// TODO: make this arguments +const contractAddress = '0x91A425C1CA320A99a09BE1bee114Fce5d30153d9'; +const params = [ + 3, // tokenId + '97e7908f70f0862d753c66689ff09e70caa43df2', // commit hash + 'https://github.com/org/new-repo', // repo + 'new-author', // author +]; + +(async () => { + const contract = await hre.ethers.getContractAt( + 'FleekERC721', + contractAddress + ); + + const transaction = await contract.upgradeTokenBuild(...params); + + console.log('Response: ', transaction); +})();