diff --git a/.env.production b/.env.production index 340abfe..f904884 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,11 @@ +### + # @LastEditors: John + # @Date: 2024-07-02 11:31:07 + # @LastEditTime: 2024-07-18 17:35:13 + # @Author: John +### VITE_BASE_URL=/ -VITE_BASE_API_URL=/dev +VITE_BASE_API_URL=/api VITE_PARTICIPATE_CHAIN_ID=56 VITE_PURCHASED_CONTRACT_ADDRESS= VITE_NETWORK_USDT_ADDRESS= diff --git a/.env.test b/.env.test index 3dae2e1..9f8e15b 100644 --- a/.env.test +++ b/.env.test @@ -1,13 +1,13 @@ ### # @LastEditors: John # @Date: 2024-06-24 18:38:45 - # @LastEditTime: 2024-07-10 15:24:55 + # @LastEditTime: 2024-07-18 18:43:53 # @Author: John ### VITE_BASE_URL=http://wwwtest.exgo.pro VITE_BASE_API_URL=http://wwwtest.exgo.pro VITE_PARTICIPATE_CHAIN_ID=97 -VITE_PURCHASED_CONTRACT_ADDRESS=0xcA03e32ab7731cD721239A7AD24f3d185e4d63CD +VITE_PURCHASED_CONTRACT_ADDRESS=0xdccBd0FbFd51dA16AEDc8b1985f3eFDA3F380944 VITE_RECEIVE_RAMB_CONTRACT_ADDRESS=0x944fBF12c9b77BFfFA223CE1568F28820d319c2F VITE_NETWORK_USDT_ADDRESS=0x6d528B0a62f8cDdf4B3F6961D70F4f4a18a92A0D VITE_CHECK_TRANSACTION_DETAILS_URL=https://testnet.bscscan.com/ \ No newline at end of file diff --git a/src/contract/abi/RedDevils.json b/src/contract/abi/RedDevils.json index 8280548..4e4ebb9 100644 --- a/src/contract/abi/RedDevils.json +++ b/src/contract/abi/RedDevils.json @@ -15,6 +15,11 @@ "internalType": "uint256", "name": "paymentType", "type": "uint256" + }, + { + "internalType": "string", + "name": "NFTURI", + "type": "string" } ], "name": "buyHMNFT", @@ -32,7 +37,7 @@ "inputs": [ { "internalType": "address", - "name": "hongMoAddr", + "name": "EquityNFTAddr", "type": "address" }, { @@ -168,6 +173,11 @@ "internalType": "address", "name": "addr", "type": "address" + }, + { + "internalType": "string", + "name": "NFTURI", + "type": "string" } ], "name": "rewardNFT", @@ -321,6 +331,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "EquityNFT", + "outputs": [ + { + "internalType": "contract RedDevilEquityNFT", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -340,19 +363,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "hongMoNFT", - "outputs": [ - { - "internalType": "contract HongMoNFT", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "owner", diff --git a/src/contract/utils.ts b/src/contract/utils.ts index ffc9ad9..86b2d5a 100644 --- a/src/contract/utils.ts +++ b/src/contract/utils.ts @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-06-19 15:48:57 - * @LastEditTime: 2024-07-03 10:44:58 + * @LastEditTime: 2024-07-18 18:33:04 * @Author: John */ import { config } from "@/components/WalletProvider"; @@ -167,14 +167,15 @@ export async function payByContract( if (approvedU < amount) { await authorizedU(amount); } - - console.log("参数:", amount, orderID, payInduction); + const NFTURI = + "https://gateway.pinata.cloud/ipfs/QmWxBbFG3WJXVTDqrFUPhMuLmeHqKNBBkzSuvQyyk7ftfi/CodeConqueror-Bnb.json"; + console.log("参数:", amount, orderID, payInduction, NFTURI); estimateGas(config, { to: import.meta.env.VITE_PURCHASED_CONTRACT_ADDRESS, data: encodeFunctionData({ abi: RedDevilsAbi, functionName: "buyHMNFT", - args: [amount, orderID, payInduction], + args: [amount, orderID, payInduction, NFTURI], }), }) .then((gas) => { @@ -184,7 +185,7 @@ export async function payByContract( abi: RedDevilsAbi, address: import.meta.env.VITE_PURCHASED_CONTRACT_ADDRESS, functionName: "buyHMNFT", - args: [amount, orderID, payInduction], + args: [amount, orderID, payInduction, NFTURI], gas: gasPrice, }) .then((receipt) => {