From 5785a9888ca161b6fff7f7d275fdc382dae96ce1 Mon Sep 17 00:00:00 2001 From: Vivek Jain Date: Fri, 20 Dec 2024 18:38:02 +0530 Subject: [PATCH] Add recipient address --- .../developer/iota-move-ctf/challenge_0.mdx | 5 +++- .../challenge_0/sources/leap_frog_nft.move | 3 +- .../src/components/CTF/mint-leap-frog-nft.tsx | 29 ++++++++++++++----- docs/site/src/utils/ctf-utils.ts | 4 +-- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/docs/content/developer/iota-move-ctf/challenge_0.mdx b/docs/content/developer/iota-move-ctf/challenge_0.mdx index a111f20b44f..fc358cb968a 100644 --- a/docs/content/developer/iota-move-ctf/challenge_0.mdx +++ b/docs/content/developer/iota-move-ctf/challenge_0.mdx @@ -11,7 +11,7 @@ Alternatively, you can use the testnet explorer to call the module's function di ## Deployed Package Address: ``` -Package Address: 0x972f3cfc6a824a319485a8c7e9e8bc0ad845e1682d277c6b4d10b5c9511685d7 +Package Address: 0x649884331fa662235b2c06c6eb488e5327105dded1331f6b7541ef4fdbd9eeca ``` ## Leap Frog NFT Module: @@ -19,4 +19,7 @@ Package Address: 0x972f3cfc6a824a319485a8c7e9e8bc0ad845e1682d277c6b4d10b5c951168 ```move file=/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move ``` +Good luck in capturing your first flag! + + \ No newline at end of file diff --git a/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move b/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move index 13840b37089..9ffaf7d97f3 100644 --- a/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move +++ b/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move @@ -32,6 +32,7 @@ module leapFrog::leap_frog_nft { name: vector, description: vector, url: vector, + recipient: address, ctx: &mut TxContext ) { let sender = tx_context::sender(ctx); @@ -48,7 +49,7 @@ module leapFrog::leap_frog_nft { name: nft.name, }); - transfer::public_transfer(nft, sender); + transfer::public_transfer(nft, recipient); } public fun transfer( diff --git a/docs/site/src/components/CTF/mint-leap-frog-nft.tsx b/docs/site/src/components/CTF/mint-leap-frog-nft.tsx index d4e095d5c5a..c5d20acdc14 100644 --- a/docs/site/src/components/CTF/mint-leap-frog-nft.tsx +++ b/docs/site/src/components/CTF/mint-leap-frog-nft.tsx @@ -20,6 +20,7 @@ const MintLeapFrogNFT: React.FC = () => { name:'', description:'', url:'', + address:'' }); const [coins, setCoins] = useState(null); const [showPopup, setShowPopup] = useState(false); @@ -52,8 +53,9 @@ const MintLeapFrogNFT: React.FC = () => { }; return ( -
-
+
+
+ { name:e.target.value }))} placeholder="Enter name" - className="input-field mr-2" + className="input-field mb-4" /> + { description:e.target.value }))} placeholder="Enter description" - className="input-field mr-2" + className="input-field mb-4" /> + { url:e.target.value }))} placeholder="Enter url" - className="input-field mr-2" + className="input-field mb-4" + /> + + setNFT((prevState) => ({ + ...prevState, + address:e.target.value + }))} + placeholder="Enter recipient address" + className="input-field mb-4" />
diff --git a/docs/site/src/utils/ctf-utils.ts b/docs/site/src/utils/ctf-utils.ts index b85e2662054..99ab0a4a53b 100644 --- a/docs/site/src/utils/ctf-utils.ts +++ b/docs/site/src/utils/ctf-utils.ts @@ -116,7 +116,7 @@ export const handleMintLeapFrogSubmit = async ({ const NETWORKS = { testnet: { url: getFullnodeUrl('testnet') }, }; - const NFTPackageAddress = "0x972f3cfc6a824a319485a8c7e9e8bc0ad845e1682d277c6b4d10b5c9511685d7" + const NFTPackageAddress = "0x649884331fa662235b2c06c6eb488e5327105dded1331f6b7541ef4fdbd9eeca" const client = new IotaClient({ url: NETWORKS.testnet.url }); const message = 'Congratulations! You have successfully completed this level!'; @@ -134,7 +134,7 @@ export const handleMintLeapFrogSubmit = async ({ tx.setGasBudget(50000000); tx.moveCall({ target: `${NFTPackageAddress}::leap_frog_nft::mint_to_sender`, - arguments: [tx.pure.vector('u8', arg0), tx.pure.vector('u8', arg1), tx.pure.vector('u8', arg2)], + arguments: [tx.pure.vector('u8', arg0), tx.pure.vector('u8', arg1), tx.pure.vector('u8', arg2), tx.pure.address(nft.address)], }); return tx; };