Skip to content

Commit

Permalink
a bunch...
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennerSpear committed Jan 22, 2022
1 parent 227674f commit 396c7f7
Show file tree
Hide file tree
Showing 17 changed files with 17,382 additions and 4,121 deletions.
12 changes: 7 additions & 5 deletions dev/manual.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import { webhookOptions, fetcher } from '../utils/index.mjs';
// const minterAddress = '0xFb6cf36C7C765E3Ff96e83463b26C9781D2Fdd2d';
// const tokenId = 995;

const minterAddress = '0xF1a9F5AEb0F975489aC2628A22040Cf42E9fE8DD';
const tokenId = 22;
const minterAddress = '0x45daafd3dbf3000e9d9f8ee1fb5c7b39ab06b3aa';
const tokenId = 4;

const local = 'https://tokengarden.loca.lt/api/v1/newTransaction';
const dev = 'https://dev.tokengarden.art/api/v1/newTransaction';
const local = 'https://heartbeat.loca.lt/api/v1/newTransaction';
const dev = 'https://heartbeat-dev.themetagame.xyz/api/v1/newTransaction';

const env = local;

async function main() {
async function runOnce() {
Expand All @@ -27,7 +29,7 @@ async function main() {

console.log('body', body);

await fetcher(local, webhookOptions(body), 1);
await fetcher(env, webhookOptions(body), 1);
// const result = await fetcher(
// 'https://tokengarden.loca.lt/api/v1/dev/safe/timerTest',
// webhookOptions(body),
Expand Down
8 changes: 4 additions & 4 deletions dev/manualLoop.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { webhookOptions, TOKEN_GARDEN_WEBHOOK_URL, fetcher, sleep } from '../utils/index.mjs';
import { webhookOptions, HEARTBEAT_WEBHOOK_URL, fetcher, sleep } from '../utils/index.mjs';
import fs from 'fs';

// const minterAddress = '0x001cF1FAa42b18021c90A29e622e83fffE2Be6ce';
Expand All @@ -9,7 +9,7 @@ async function main() {

async function runLoop() {
const tuples = Object.entries(addresses);
for (let i = 0; i < 20; i++) {
for (let i = 0; i < 1; i++) {
const [tokenId, minterAddress] = tuples[i];

const body = {
Expand All @@ -19,7 +19,7 @@ async function main() {

console.log(body);

const result = await fetcher(TOKEN_GARDEN_WEBHOOK_URL, webhookOptions(body));
const { result } = await fetcher(HEARTBEAT_WEBHOOK_URL, webhookOptions(body));

if (result.error) {
console.error(result.message);
Expand All @@ -29,7 +29,7 @@ async function main() {
`${result.minterAddress} with tokenId ${result.tokenId} has been added or updated`,
);
}
// await sleep(1000);
await sleep(1000);
}
}

Expand Down
7 changes: 5 additions & 2 deletions dev/mint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import { getTokenGardenContract } from '../utils/dev.mjs';
async function main() {
// const addresses = JSON.parse(fs.readFileSync('./output/addresses.json'));

const contractAddress = TOKEN_GARDEN_CONTRACT_ADDRESS;
// const contractAddress = TOKEN_GARDEN_CONTRACT_ADDRESS;
// const contractAddress = '0xbc96d12eff9c5d55b31d094ea85d9960088f3bef'; // old token garden
// const contractAddress = '0xbc96d12EFF9C5D55b31D094EA85d9960088F3beF';

const contractAddress = '0xbC37a38D7647BEe80d23b296fF61f737C574126E'; // heartbeat rinkeby

async function runLoop() {
const [tokenGardenContract, getSigner] = getTokenGardenContract('rinkeby', contractAddress);

const promises = [];

for (let i = 0; i < 10; i++) {
for (let i = 21; i < 40; i++) {
console.log(`submitting tx ${i} for ${contractAddress}`);
const tokenGardenContractWritable = tokenGardenContract.connect(getSigner(i));
const value = 0;
Expand Down
73 changes: 0 additions & 73 deletions dev/updateAllMetadata.mjs

This file was deleted.

107 changes: 107 additions & 0 deletions example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"name": "brenner.eth's Token Garden",
"description": "A garden that's been growning since June 2021. It has 18 flowers so far.",
"image": "ipfs://QmX7i66cX4kibjoBJoKRLisfBTRz5DYh47vEfjeEik4WZE",
"external_url": "https://www.tokengarden.art/garden/2",
"address": "0x17a059b6b0c8af433032d554b0392995155452e6",
"uniqueNFTCount": 18,
"totalNFTCount": 42,
"nfts": {
"0x77a679db25d504d83d59b32467545c5a3783c88b": {
"tokenSymbol": "ANON",
"tokenName": "ANON",
"count": 10
},
"0x5e5c8cab4a16295d6ddaedbd596d506fd440eb97": {
"tokenSymbol": "BADDIE",
"tokenName": "Baddies",
"count": 1
},
"0x22c1f6050e56d2876009903609a2cc3fef83b415": {
"tokenSymbol": "The Proof of Attendance Protocol",
"tokenName": "POAP",
"count": 1,
"special": true
},
"0x1003fcba76b07bb978b79a71d11e957dcdd54ebd": {
"tokenSymbol": "PBP#2066",
"tokenName": "PartyBid Punk#2066",
"count": 1
},
"0xcc56775606730c96ea245d9cf3890247f1c57fb1": {
"tokenSymbol": "AL",
"tokenName": "AbstractLoot",
"count": 1
},
"0x3d3d9cc92dba4559d0f862e34faa33e9967f6534": {
"tokenSymbol": "CAPTCHA",
"tokenName": "CAPTCHAS",
"count": 6
},
"0x7afe30cb3e53dba6801aa0ea647a0ecea7cbe18d": {
"tokenSymbol": "LootRealm",
"tokenName": "Realms (for Adventurers)",
"count": 2
},
"0x448f3219cf2a23b0527a7a0158e7264b87f635db": {
"tokenSymbol": "NAUT",
"tokenName": "The Blitnauts",
"count": 1
},
"0x4b3406a41399c7fd2ba65cbc93697ad9e7ea61e5": {
"tokenSymbol": "POETS",
"tokenName": "Lost Poets",
"count": 2,
"special": true
},
"0x2ba797c234c8fe25847225b11b616bce729b0b53": {
"tokenSymbol": "BBLOCK",
"tokenName": "Birthblock",
"count": 1,
"special": true
},
"0x5bdf397bb2912859dbd8011f320a222f79a28d2e": {
"tokenSymbol": "CORRUPT",
"tokenName": "Corruptions",
"count": 3
},
"0x45d1f656ca86fc0bf1bacdf4e2fee9def47e0466": {
"tokenSymbol": "NFK",
"tokenName": "Nifkey",
"count": 1
},
"0xb228d7b6e099618ca71bd5522b3a8c3788a8f172": {
"tokenSymbol": "POOLEXEC",
"tokenName": "Poolsuite - Executive Member",
"count": 1
},
"0x9ef14cc7c558a70fbb6480ce58042feebaa1972e": {
"tokenSymbol": "BLANK",
"tokenName": "BlankArt",
"count": 5,
"special": true
},
"0x0beed7099af7514ccedf642cfea435731176fb02": {
"tokenSymbol": "DUSK",
"tokenName": "DuskBreakers",
"count": 3
},
"0xca21d4228cdcc68d4e23807e5e370c07577dd152": {
"tokenSymbol": "ZORB",
"tokenName": "Zorbs",
"count": 1,
"special": true
},
"0x7d414bc0482432d2d74021095256aab2e6d3f6b8": {
"tokenSymbol": "TGRDN",
"tokenName": "Token Garden",
"count": 1
},
"7.1507999364243615e+47": {
"tokenSymbol": "TGRDN",
"tokenName": "Token Garden",
"count": 1,
"special": true
}
}
}
44 changes: 44 additions & 0 deletions fix-prod-token-garden/checkMetadata.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {
TOKEN_GARDEN_CONTRACT_ADDRESS,
fetcher,
openseaFetchOptions,
sleep,
} from '../utils/index.mjs';

async function main() {
async function runLoop() {
for (let i = 423; i <= 437; i++) {
const openseaForceUpdateURL = `https://api.opensea.io/api/v1/asset/${TOKEN_GARDEN_CONTRACT_ADDRESS}/${i}/?force_update=true`;
const getNftInfoURL = `https://api.opensea.io/api/v1/asset/${TOKEN_GARDEN_CONTRACT_ADDRESS}/${i}`;

console.log(`checking metadata for ${i}`);

const openseaResult = await fetcher(getNftInfoURL, openseaFetchOptions);

// console.log(openseaResult);

const originalImageURL = openseaResult.image_original_url;
if (!(originalImageURL || '').includes('ipfs.io')) {
console.log(`no ipfs url found for ${i}: ${originalImageURL}`);
console.log(`updating metadata for ${i}`);
const forceResult = await fetcher(openseaForceUpdateURL, openseaFetchOptions);
if (forceResult.error) {
console.log(forceResult);
}
}
if (openseaResult.error) {
console.error(openseaResult);
}
await sleep(300);
}
}

await runLoop();
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
12 changes: 10 additions & 2 deletions fix-prod-token-garden/resendMultiple.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { webhookOptions, TOKEN_GARDEN_WEBHOOK_URL, fetcher } from '../utils/inde
import fs from 'fs';

async function main() {
const addresses = JSON.parse(fs.readFileSync('...'));
const addresses = JSON.parse(fs.readFileSync('./manual-fix-2.json'));

async function runLoop() {
for (const [key, value] of Object.entries(addresses)) {
Expand All @@ -11,7 +11,13 @@ async function main() {
tokenId: key,
};

const result = await fetcher(TOKEN_GARDEN_WEBHOOK_URL, webhookOptions(body));
const { status, message, result } = await fetcher(
TOKEN_GARDEN_WEBHOOK_URL,
webhookOptions(body),
);

console.log('status:', status);
console.log('message:', message);

if (result.error) {
console.error(result.message);
Expand All @@ -21,6 +27,8 @@ async function main() {
`${result.minterAddress} with tokenId ${result.tokenId} has been added or updated`,
);
}

await new Promise((resolve) => setTimeout(resolve, 3000));
}
}

Expand Down
23 changes: 15 additions & 8 deletions fix-prod-token-garden/resendOnce.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import { webhookOptions, TOKEN_GARDEN_WEBHOOK_URL, fetcher } from '../utils/index.mjs';

const minterAddress = 'xxx';
const tokenId = 0;
const body = {
minterAddress: '0x45daafd3dbf3000e9d9f8ee1fb5c7b39ab06b3aa',
tokenId: '412',
forceScreenshot: true,
};

// 0x90b56d0e27e74c3c5e66ebfcaf12dc5ecf0665dd
// 438

async function main() {
async function runOnce() {
const body = {
minterAddress,
tokenId,
};

console.log('body', body);

const result = await fetcher(TOKEN_GARDEN_WEBHOOK_URL, webhookOptions(body));
const { status, message, result } = await fetcher(
TOKEN_GARDEN_WEBHOOK_URL,
webhookOptions(body),
);

console.log('status:', status);
console.log('message:', message);

if (result.error) {
console.error(result.message);
Expand Down
Loading

0 comments on commit 396c7f7

Please sign in to comment.