From 17bdf9836129ffdad8db6a57173c213f0e6e6db2 Mon Sep 17 00:00:00 2001 From: siegfriedbz Date: Sat, 22 Nov 2025 16:39:24 +0100 Subject: [PATCH] feat(fe): update contracts addresses and abis --- fe/app/_contracts/forge-contract-config.ts | 206 +------------- fe/app/_contracts/ftoken-contract-config.ts | 280 +------------------- fe/app/_hooks/use-cool-down.ts | 2 +- 3 files changed, 5 insertions(+), 483 deletions(-) diff --git a/fe/app/_contracts/forge-contract-config.ts b/fe/app/_contracts/forge-contract-config.ts index 3f3bc0c..cf95d61 100644 --- a/fe/app/_contracts/forge-contract-config.ts +++ b/fe/app/_contracts/forge-contract-config.ts @@ -1,206 +1,4 @@ export const forgeContractConfig = { - address: "0xD4922B783f762FEB81cEb08D6F1f4c45A8cAa148", - abi: [ - { - inputs: [ - { internalType: "string", name: "_tokenUri", type: "string" }, - { internalType: "uint256", name: "_maxTokenId", type: "uint256" }, - { internalType: "uint256", name: "_coolDownDelay", type: "uint256" }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }], - name: "Forge__CanNotTradeForSameToken", - type: "error", - }, - { - inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }], - name: "Forge__CanOnlyBurnForgedToken", - type: "error", - }, - { - inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }], - name: "Forge__CanOnlyTradeForBasicToken", - type: "error", - }, - { - inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }], - name: "Forge__InvalidToken", - type: "error", - }, - { - inputs: [{ internalType: "address", name: "user", type: "address" }], - name: "Forge__UserInCoolDown", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - indexed: true, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Forge__BurnToken", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - indexed: true, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Forge__ForgeToken", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - indexed: true, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Forge__MintToken", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "burnedTokenId", - type: "uint256", - }, - { - indexed: true, - internalType: "uint256", - name: "mintedTokenId", - type: "uint256", - }, - ], - name: "Forge__Trade", - type: "event", - }, - { - inputs: [], - name: "I_COOL_DOWN_DELAY", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "I_MAX_TOKEN_ID", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "I_TOKEN", - outputs: [{ internalType: "contract FToken", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_tokenId", type: "uint256" }, - { internalType: "uint256", name: "_value", type: "uint256" }, - ], - name: "burn", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_tokenId", type: "uint256" }], - name: "getForgeData", - outputs: [ - { internalType: "uint256[]", name: "", type: "uint256[]" }, - { internalType: "uint256[]", name: "", type: "uint256[]" }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_tokenId", type: "uint256" }], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_tokenIdToBurn", type: "uint256" }, - { internalType: "uint256", name: "_tokenIdToMint", type: "uint256" }, - ], - name: "trade", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "user", type: "address" }], - name: "userCoolDownTimer", - outputs: [ - { internalType: "uint256", name: "coolDownTimer", type: "uint256" }, - ], - stateMutability: "view", - type: "function", - }, - ], + address: "0x7d8A16168D337B2241fCbA1cc5bd196479DF1F0C", + abi: [{"inputs":[{"internalType":"string","name":"_tokenUri","type":"string"},{"internalType":"uint256","name":"_maxTokenId","type":"uint256"},{"internalType":"uint256","name":"_coolDownDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Forge__CanNotTradeForSameToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Forge__CanOnlyBurnForgedToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Forge__CanOnlyTradeForBasicToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Forge__InvalidToken","type":"error"},{"inputs":[],"name":"Forge__OnlyOwnerAllowed","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"Forge__UserInCoolDown","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Forge__BurnToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Forge__ForgeToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Forge__MintToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"burnedTokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"mintedTokenId","type":"uint256"}],"name":"Forge__Trade","type":"event"},{"inputs":[],"name":"I_MAX_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"I_OWNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"I_TOKEN","outputs":[{"internalType":"contract FToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"coolDownDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getForgeData","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_coolDownDelay","type":"uint256"}],"name":"setCoolDownDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenIdToBurn","type":"uint256"},{"internalType":"uint256","name":"_tokenIdToMint","type":"uint256"}],"name":"trade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userCoolDownTimer","outputs":[{"internalType":"uint256","name":"coolDownTimer","type":"uint256"}],"stateMutability":"view","type":"function"}] } as const; diff --git a/fe/app/_contracts/ftoken-contract-config.ts b/fe/app/_contracts/ftoken-contract-config.ts index 86f10b1..a4cd6fc 100644 --- a/fe/app/_contracts/ftoken-contract-config.ts +++ b/fe/app/_contracts/ftoken-contract-config.ts @@ -1,280 +1,4 @@ export const fTokenContractConfig = { - address: "0x8281b01D35A70BDc17D85c6df3d45B67745a5F9f", - abi: [ - { - inputs: [{ internalType: "string", name: "uri_", type: "string" }], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [ - { internalType: "address", name: "sender", type: "address" }, - { internalType: "uint256", name: "balance", type: "uint256" }, - { internalType: "uint256", name: "needed", type: "uint256" }, - { internalType: "uint256", name: "tokenId", type: "uint256" }, - ], - name: "ERC1155InsufficientBalance", - type: "error", - }, - { - inputs: [{ internalType: "address", name: "approver", type: "address" }], - name: "ERC1155InvalidApprover", - type: "error", - }, - { - inputs: [ - { internalType: "uint256", name: "idsLength", type: "uint256" }, - { internalType: "uint256", name: "valuesLength", type: "uint256" }, - ], - name: "ERC1155InvalidArrayLength", - type: "error", - }, - { - inputs: [{ internalType: "address", name: "operator", type: "address" }], - name: "ERC1155InvalidOperator", - type: "error", - }, - { - inputs: [{ internalType: "address", name: "receiver", type: "address" }], - name: "ERC1155InvalidReceiver", - type: "error", - }, - { - inputs: [{ internalType: "address", name: "sender", type: "address" }], - name: "ERC1155InvalidSender", - type: "error", - }, - { - inputs: [ - { internalType: "address", name: "operator", type: "address" }, - { internalType: "address", name: "owner", type: "address" }, - ], - name: "ERC1155MissingApprovalForAll", - type: "error", - }, - { inputs: [], name: "FToken__OnlyOwnerAllowed", type: "error" }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { indexed: true, internalType: "address", name: "to", type: "address" }, - { - indexed: false, - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - { - indexed: false, - internalType: "uint256[]", - name: "values", - type: "uint256[]", - }, - ], - name: "TransferBatch", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { indexed: true, internalType: "address", name: "to", type: "address" }, - { - indexed: false, - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "TransferSingle", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "string", - name: "value", - type: "string", - }, - { indexed: true, internalType: "uint256", name: "id", type: "uint256" }, - ], - name: "URI", - type: "event", - }, - { - inputs: [], - name: "I_OWNER", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "account", type: "address" }, - { internalType: "uint256", name: "id", type: "uint256" }, - ], - name: "balanceOf", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address[]", name: "accounts", type: "address[]" }, - { internalType: "uint256[]", name: "ids", type: "uint256[]" }, - ], - name: "balanceOfBatch", - outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_from", type: "address" }, - { internalType: "uint256", name: "_id", type: "uint256" }, - { internalType: "uint256", name: "_value", type: "uint256" }, - ], - name: "burn", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_from", type: "address" }, - { internalType: "uint256[]", name: "_ids", type: "uint256[]" }, - { internalType: "uint256[]", name: "_values", type: "uint256[]" }, - ], - name: "burnBatch", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "account", type: "address" }, - { internalType: "address", name: "operator", type: "address" }, - ], - name: "isApprovedForAll", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_to", type: "address" }, - { internalType: "uint256", name: "_id", type: "uint256" }, - { internalType: "uint256", name: "_value", type: "uint256" }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "from", type: "address" }, - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256[]", name: "ids", type: "uint256[]" }, - { internalType: "uint256[]", name: "values", type: "uint256[]" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "safeBatchTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "from", type: "address" }, - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256", name: "id", type: "uint256" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "operator", type: "address" }, - { internalType: "bool", name: "approved", type: "bool" }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }], - name: "supportsInterface", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "id", type: "uint256" }], - name: "uri", - outputs: [{ internalType: "string", name: "", type: "string" }], - stateMutability: "view", - type: "function", - }, - ], + address: "0xa6D68eDA0993364481C2c5DA8d6cd43e03f592bA", + abi: [{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[],"name":"FToken__OnlyOwnerAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"I_OWNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}] } as const; diff --git a/fe/app/_hooks/use-cool-down.ts b/fe/app/_hooks/use-cool-down.ts index 5524d07..bee5cfa 100644 --- a/fe/app/_hooks/use-cool-down.ts +++ b/fe/app/_hooks/use-cool-down.ts @@ -18,7 +18,7 @@ export const useCoolDown = (params: Params) => { const { data: coolDownDelay } = useReadContract({ ...forgeContractConfig, - functionName: "I_COOL_DOWN_DELAY", + functionName: "coolDownDelay", }); const coolDownDelayInMs = useMemo(