Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
bithalo committed Jun 11, 2024
1 parent 0701d9c commit 373ee32
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,7 @@ <h2 t-id="40" style="width: 100%; max-width: 900px; align-items: center; display
//the graphics card to moderate, they can call a list of volunteer services who run AI WebGPT to filter it(and maybe recommend tags)
//for them based on their criteria. One way to enforce a search protocol is have those who post to markets do so from a separate contract.
//This way they can also be the ones required to remove the search tags and the contract manages everything.
var tempCurator = "0x25A2c592DDD5F930a9CB271b9AC3e72bbBc3d351";
async function loadMarkets(low = 1, high = 1, searchText = '') {
var DDEcontract3 = DDEcontract;
if(DDEcontract == '') {
Expand All @@ -2321,6 +2322,16 @@ <h2 t-id="40" style="width: 100%; max-width: 900px; align-items: center; display
currentMarketsLength = DOMPurify.sanitize(result);
mlength = result;
});
var listlen = DOMPurify.sanitize(await DDEcontract3.methods.getArrayLength(tempCurator,3).call());
var udata = {};
if(listlen > 0) {
var udata2 = JSON.parse(DOMPurify.sanitize(await DDEcontract.methods.userdata(tempCurator, listlen-1).call()));
if(typeof udata2 === 'object' && 'users' in udata2) {
for(var uinx = 0; uinx < udata2['users'].length; uinx++) {
udata[udata2['users'][uinx]] = 1;
}
}
}
var index = 1;
if(high > 1 && low != 0 && high <= mlength && low <= high) {
index = low;
Expand Down Expand Up @@ -2351,6 +2362,9 @@ <h2 t-id="40" style="width: 100%; max-width: 900px; align-items: center; display
expiredOffers.push(hash);
} else {
jsondata = await getOrderHash(hash);
if(udata.hasOwnProperty(jsondata.sender) || udata.hasOwnProperty(jsondata.recipient)) {
continue;
}
if(parseInt(jsondata.timelimit[1]) != 0) {
if(parseInt(jsondata.timelimit[1]) > parseInt(CurrentTimeStamp)) {
if(!marketOffers.hasOwnProperty(offerID)) {
Expand Down Expand Up @@ -2419,6 +2433,9 @@ <h2 t-id="40" style="width: 100%; max-width: 900px; align-items: center; display
added = 1;
} else {
jsondata = await getOrderHash(hash);
if(udata.hasOwnProperty(jsondata.sender) || udata.hasOwnProperty(jsondata.recipient)) {
continue;
}
if(parseInt(jsondata.timelimit[1]) != 0) {
if(parseInt(jsondata.timelimit[1]) > parseInt(CurrentTimeStamp)) {
if(!marketOffers.hasOwnProperty(offerID)) {
Expand Down Expand Up @@ -2464,6 +2481,9 @@ <h2 t-id="40" style="width: 100%; max-width: 900px; align-items: center; display
if (offerID == 0) {
} else {
jsondata = await getOrderHash(hash);
if(udata.hasOwnProperty(jsondata.sender) || udata.hasOwnProperty(jsondata.recipient)) {
throw new Error('a');
}
if(parseInt(jsondata.timelimit[1]) != 0) {
if(parseInt(jsondata.timelimit[1]) > parseInt(CurrentTimeStamp)) {
if(!marketOffers.hasOwnProperty(offerID)) {
Expand Down Expand Up @@ -2528,11 +2548,14 @@ <h2 t-id="40" style="width: 100%; max-width: 900px; align-items: center; display
}
jsondata = marketOffers[hash];
} else {
jsondata = await getOrderHash(hash);
if(udata.hasOwnProperty(jsondata.sender) || udata.hasOwnProperty(jsondata.recipient)) {
return;
}
if(!marketOffers.hasOwnProperty(offerID)) {
marketOffers.indices.push(offerID);
}
marketOffers[offerID] = hash;
jsondata = await getOrderHash(hash);
if(parseInt(jsondata.timelimit[1]) != 0) {
if(parseInt(jsondata.timelimit[1]) > parseInt(CurrentTimeStamp)) {
marketOffers[hash] = jsondata;
Expand Down Expand Up @@ -2575,6 +2598,9 @@ <h2 t-id="40" style="width: 100%; max-width: 900px; align-items: center; display
await DDEcontract3.methods.markets(index).call().then(async function (hash) {
hash = DOMPurify.sanitize(hash);
jsondata = await getOrderHash(hash);
if(udata.hasOwnProperty(jsondata.sender) || udata.hasOwnProperty(jsondata.recipient)) {
return;
}
if(parseInt(jsondata.timelimit[1]) != 0) {
if(parseInt(jsondata.timelimit[1]) > parseInt(CurrentTimeStamp)) {
if(!marketOffers.hasOwnProperty(index)) {
Expand Down Expand Up @@ -5915,7 +5941,10 @@ <h2>` + translateThis('Create Contract') + `</h2>
}
});
}

async function postData(myuserdata) {
await DDEcontract.methods.adduserdata(JSON.stringify(myuserdata)).send({"from":myaccounts,...gasOptions[gasSetting]});
await Swal.fire(translateThis("Data added!"));
}
async function addAPI(text) {
var data = CryptoJS.AES.encrypt(JSON.stringify(text), AESkey).toString();
console.log(data)
Expand Down

0 comments on commit 373ee32

Please sign in to comment.