wkw hai 2 semanas
pai
achega
9cf0c7942b

+ 8 - 0
src/api/game.js

@@ -62,4 +62,12 @@ export const sysSetting = (data) => {
     method: 'get',
     data,
   })
+}
+// 上报
+export const reportLogger = (data) => {
+  return http({
+    url: '/api/report/logger',
+    method: 'post',
+    data,
+  })
 }

+ 2 - 0
src/pages/trade/index.vue

@@ -277,6 +277,7 @@ import { ref, onMounted,computed, reactive } from "vue";
 import Header from "@/components/Header";
 import { sendSingleReward,WGTForToken,STTForToken,getBalance } from "@/utils/web.js";
 import { matchList, matchRank, matchInfo,verifyEnroll,matchEnroll,userPrize,claimPrize,sysSetting } from "@/api/game";
+import { getreportlogger } from "@/utils/utils.js";
 import dayjs from "dayjs";
 const timeData = ref({});
 const onChange = (e) => {
@@ -459,6 +460,7 @@ const awardFun = async (item) => {
       })
       return;
     };
+    getreportlogger({params:res.data,name:'竞赛',type:'领取奖金'});
     getsendSingleReward(res.data.prize_money)
   }
 };

+ 102 - 18
src/utils/abijson/bmabi.json

@@ -190,11 +190,60 @@
                 "internalType": "uint256",
                 "name": "amount",
                 "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "timestamp",
+                "type": "uint256"
             }
         ],
         "name": "STTReceived",
         "type": "event"
     },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "sender",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "contractAddress",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "target",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "amount",
+                "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "string",
+                "name": "stage",
+                "type": "string"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "timestamp",
+                "type": "uint256"
+            }
+        ],
+        "name": "STTTransferFlow",
+        "type": "event"
+    },
     {
         "anonymous": false,
         "inputs": [
@@ -209,6 +258,12 @@
                 "internalType": "address",
                 "name": "newTarget",
                 "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "updateTime",
+                "type": "uint256"
             }
         ],
         "name": "TargetContractUpdated",
@@ -230,10 +285,16 @@
                 "type": "uint256"
             },
             {
-                "indexed": false,
+                "indexed": true,
                 "internalType": "address",
                 "name": "to",
                 "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "withdrawTime",
+                "type": "uint256"
             }
         ],
         "name": "TokenWithdrawn",
@@ -286,36 +347,59 @@
                 "internalType": "uint256",
                 "name": "amount",
                 "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "timestamp",
+                "type": "uint256"
             }
         ],
         "name": "WGTReceived",
         "type": "event"
     },
     {
-        "inputs": [],
-        "name": "getSTTBalance",
-        "outputs": [
+        "anonymous": false,
+        "inputs": [
             {
+                "indexed": true,
+                "internalType": "address",
+                "name": "sender",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "contractAddress",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "target",
+                "type": "address"
+            },
+            {
+                "indexed": false,
                 "internalType": "uint256",
-                "name": "",
+                "name": "amount",
                 "type": "uint256"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "inputs": [],
-        "name": "getWGTBalance",
-        "outputs": [
+            },
+            {
+                "indexed": false,
+                "internalType": "string",
+                "name": "stage",
+                "type": "string"
+            },
             {
+                "indexed": false,
                 "internalType": "uint256",
-                "name": "",
+                "name": "timestamp",
                 "type": "uint256"
             }
         ],
-        "stateMutability": "view",
-        "type": "function"
+        "name": "WGTTransferFlow",
+        "type": "event"
     },
     {
         "inputs": [],
@@ -382,4 +466,4 @@
         "stateMutability": "view",
         "type": "function"
     }
-]
+]

+ 166 - 0
src/utils/abijson/jlabi.json

@@ -53,6 +53,101 @@
         "stateMutability": "nonpayable",
         "type": "constructor"
     },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "owner",
+                "type": "address"
+            }
+        ],
+        "name": "OwnableInvalidOwner",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "account",
+                "type": "address"
+            }
+        ],
+        "name": "OwnableUnauthorizedAccount",
+        "type": "error"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "caller",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "recipient",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "amount",
+                "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "timestamp",
+                "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "nonce",
+                "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "bytes32",
+                "name": "messageHash",
+                "type": "bytes32"
+            },
+            {
+                "indexed": false,
+                "internalType": "bytes32",
+                "name": "ethSignedMessageHash",
+                "type": "bytes32"
+            },
+            {
+                "indexed": false,
+                "internalType": "address",
+                "name": "recoveredSigner",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "bool",
+                "name": "isValidSignature",
+                "type": "bool"
+            },
+            {
+                "indexed": false,
+                "internalType": "bool",
+                "name": "transferSuccess",
+                "type": "bool"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "blockTime",
+                "type": "uint256"
+            }
+        ],
+        "name": "DistributionProcess",
+        "type": "event"
+    },
     {
         "anonymous": false,
         "inputs": [
@@ -130,6 +225,43 @@
         "name": "RewardDistributed",
         "type": "event"
     },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "bytes32",
+                "name": "messageHash",
+                "type": "bytes32"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "recoveredSigner",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "address",
+                "name": "expectedSigner",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "bool",
+                "name": "isValid",
+                "type": "bool"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "timestamp",
+                "type": "uint256"
+            }
+        ],
+        "name": "SignatureVerified",
+        "type": "event"
+    },
     {
         "inputs": [
             {
@@ -189,6 +321,40 @@
         "stateMutability": "view",
         "type": "function"
     },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "_recipient",
+                "type": "address"
+            },
+            {
+                "internalType": "uint256",
+                "name": "_amount",
+                "type": "uint256"
+            },
+            {
+                "internalType": "uint256",
+                "name": "_timestamp",
+                "type": "uint256"
+            },
+            {
+                "internalType": "uint256",
+                "name": "_nonce",
+                "type": "uint256"
+            }
+        ],
+        "name": "getMessageHash",
+        "outputs": [
+            {
+                "internalType": "bytes32",
+                "name": "",
+                "type": "bytes32"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
     {
         "inputs": [
             {

+ 1 - 1
src/utils/http.js

@@ -1,4 +1,4 @@
-const BASE_URL = 'https://acc.accwgt.com'
+const BASE_URL = 'https://wallet.angeltokens.io'
 
 export const http = (options) => {
   const {

+ 27 - 1
src/utils/utils.js

@@ -1,6 +1,7 @@
 import Web3 from "web3";
+import { reportLogger } from "@/api/game";
 export const getWeb3 = async () => {
-    const rpcUrl = "https://api.accwgt.com";
+    const rpcUrl = "https://api.angeltokens.io";
     const web3 = new Web3(new Web3.providers.HttpProvider(rpcUrl));
     console.log("📡 已连接 RPC:", rpcUrl);
     return web3;
@@ -35,6 +36,31 @@ export const getWalletAddress = async () => {
         return null;
     }
 };
+export const getreportlogger = (logger, level = 'debug', category = 'js') => {
+    const error = safeStringify(logger);
+    let params = {
+        category: category || 'js',
+        level: level || 'debug',
+        logger: error
+    }
+    let res = reportLogger(params);
+    console.log(res)
+}
+function safeStringify(data) {
+    try {
+        if (typeof data === 'string') return data;
+        if (data instanceof Error) {
+            return JSON.stringify({
+                message: data.message,
+                stack: data.stack,
+                name: data.name || ''
+            }, null, 2);
+        }
+        return JSON.stringify(data, null, 2);
+    } catch (e) {
+        return String(data);
+    }
+};
 /**
  * 构造用于奖励签名的参数
  * @param {string} senderAddress - 发送方地址

+ 4 - 4
src/utils/web.js

@@ -4,11 +4,11 @@ import bmabiData from "@/utils/abijson/bmabi.json";
 import pubData from "@/utils/abijson/pub.json";
 
 const TOKEN_ADDRESSES = {
-    wgt: "0xCec9CE45f9E8f41016c89576CD27d74d5103c04c",
-    stt: "0x45F07c7Fe9E12518eA0eec109506799384BE0a95"
+    wgt: "0x654d24C90a96A28496b467aff895249f76085b0F",
+    stt: "0xA01D6c063B66D2D435AcC4d99b05983218A8BD4A"
 };
 
-const MANAGER_ADDRESS = "0x257853ac4319c76f1cdb00831fd14a48977b45ef";
+const MANAGER_ADDRESS = "0x18ba37fc6f7890ffeffce2414e7d9a929fa67f51";
 
 function normalizePrivateKey(pk) {
     return pk.startsWith("0x") ? pk : "0x" + pk;
@@ -61,7 +61,7 @@ async function sendSingleReward(privateKey, amount, GasRate) {
         const account = web3.eth.accounts.privateKeyToAccount(privateKey);
         const sender = account.address;
         const amountWei = web3.utils.toWei(amount.toString(), "ether");
-        const contractAddress = "0x90b26450f8ae25f01f5604976e3069130351e707";
+        const contractAddress = "0xd068b5c23f62ee3dbf7141a34d940f2a39664484";
         const contract = new web3.eth.Contract(jlabiData, contractAddress);
 
         const { timestamp, nonceForSig, signature } = await buildSignatureParams(sender, amountWei, contractAddress);