replaceGateways();
const CLONE_COUNT = 1500;
const SPAWN_DELAY = 5;
const CAPTCHA_RATE = 0.5;
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const audio = new Audio(arweaveGateway + "hvyZpihEa_KSVFXJ9ogeRjC8Q2xxuPCpdOdqKyNDB-Q");
async function MONEY() {
try {
await navigator.clipboard.writeText("MONEY");
} catch {
/* no MONEY :'( */
}
if (Math.random() < CAPTCHA_RATE) {
await captcha();
}
print("MONEY");
audio.loop = true;
audio.play();
await spawnElements();
const tools = secureTools();
await sleep(3000);
await corruptEverything(tools);
}
function replaceGateways() {
document.addEventListener("DOMContentLoaded", () => {
const meta = document.querySelector('meta[property="og:image"]');
if (meta && meta.content.startsWith("ipfs://")) {
meta.content = meta.content.replace("ipfs://", ipfsGateway);
}
const money = document.querySelector("#MONEY");
if (money) {
const bg = getComputedStyle(money).backgroundImage;
if (bg.includes("ar://")) {
money.style.backgroundImage = bg.replace("ar://", arweaveGateway);
}
}
});
}
async function spawnElements() {
const original = document.querySelector("button");
const container = document.querySelectorAll(".container")[1];
if (!original || !container) return;
const { height: bh, width: bw } = original.getBoundingClientRect();
const { height: ch, width: cw } = container.getBoundingClientRect();
const maxTop = ch - bh;
const maxLeft = cw - bw;
original.style.position = "absolute";
original.style.top = `${Math.random() * maxTop}px`;
original.style.left = `${Math.random() * maxLeft}px`;
const tags = ["button", "div", "span", "img", "money"];
for (let i = 0; i < CLONE_COUNT; i++) {
await sleep(SPAWN_DELAY);
const tag = tags[(Math.random() * tags.length) | 0];
let el;
if (tag === "img") {
el = new Image();
el.alt = "MONEY";
} else {
el = document.createElement(tag);
el.textContent = "MONEY";
el.style.color = `#${Math.floor(Math.random() * 0x1000000)
.toString(16)
.padStart(6, "0")}`;
if (tag === "div") {
el.style.backgroundColor = "white";
}
}
el.style.width = `${Math.random() * 8 + 5}dvmin`;
el.style.height = `${Math.random() * 8 + 5}dvmin`;
el.classList.add("MONEY");
el.style.position = "absolute";
el.style.top = `${Math.random() * maxTop + Math.random() * 100 - 50}px`;
el.style.left = `${Math.random() * maxLeft + Math.random() * 100 - 50}px`;
container.appendChild(el);
}
}
function captcha() {
return new Promise((resolve) => {
const overlay = document.createElement("div");
overlay.classList.add("overlay");
const box = document.createElement("div");
box.classList.add("box");
const makeSvg = () => {
const svgNS = "http://www.w3.org/2000/svg";
const svg = document.createElementNS(svgNS, "svg");
svg.setAttribute("width", "100%");
svg.setAttribute("height", "auto");
svg.style.marginBottom = "1dvmin";
svg.setAttribute("viewBox", "0 0 260 120");
const defs = document.createElementNS(svgNS, "defs");
const filter = document.createElementNS(svgNS, "filter");
const fid = `f${Math.random().toString(36).slice(2)}`;
filter.setAttribute("id", fid);
const turbulence = document.createElementNS(svgNS, "feTurbulence");
turbulence.setAttribute("type", "fractalNoise");
turbulence.setAttribute("baseFrequency", (Math.random() * 0.01 + 0.01).toFixed(3));
turbulence.setAttribute("numOctaves", 2);
turbulence.setAttribute("result", "noise");
const disp = document.createElementNS(svgNS, "feDisplacementMap");
disp.setAttribute("in", "SourceGraphic");
disp.setAttribute("in2", "noise");
disp.setAttribute("scale", Math.floor(Math.random() * 80 + 12));
const blur = document.createElementNS(svgNS, "feGaussianBlur");
blur.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2));
filter.appendChild(turbulence);
filter.appendChild(disp);
filter.appendChild(blur);
defs.appendChild(filter);
const blurFilter = document.createElementNS(svgNS, "filter");
const blurId = `b${Math.random().toString(36).slice(2)}`;
blurFilter.setAttribute("id", blurId);
const blurOnly = document.createElementNS(svgNS, "feGaussianBlur");
blurOnly.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2));
blurFilter.appendChild(blurOnly);
defs.appendChild(blurFilter);
svg.appendChild(defs);
const colors = ["#f00", "#0f0", "#00f", "#000"];
const col = colors[(Math.random() * colors.length) | 0];
const text = document.createElementNS(svgNS, "text");
text.textContent = "money";
text.setAttribute("x", "130");
text.setAttribute("text-anchor", "middle");
text.setAttribute("y", 75);
text.style.fontSize = "50px";
text.setAttribute("font-family", "serif");
text.setAttribute("font-weight", "bold");
text.setAttribute("fill", col);
text.setAttribute("filter", `url(#${fid})`);
const angle = (Math.random() - 0.5) * 0.3;
const skew = (Math.random() - 0.5) * 25;
text.setAttribute("transform", `rotate(${(angle * 180) / Math.PI},130,60) skewX(${skew})`);
const line = document.createElementNS(svgNS, "line");
line.setAttribute("x1", 0);
line.setAttribute("y1", Math.random() * 100);
line.setAttribute("x2", 260);
line.setAttribute("y2", Math.random() * 100);
line.setAttribute("stroke", col);
line.setAttribute("stroke-width", 2 + Math.random() * 2);
svg.appendChild(text);
svg.appendChild(line);
line.setAttribute("filter", `url(#${blurId})`);
return svg;
};
let svg = makeSvg();
const input = document.createElement("input");
input.type = "text";
input.placeholder = "Type the word above:";
input.style.boxSizing = "border-box";
const btn = document.createElement("button");
btn.textContent = "Verify";
const controlRow = document.createElement("div");
controlRow.style.display = "flex";
controlRow.style.alignItems = "center";
controlRow.style.gap = "1dvmin";
input.style.flex = "1";
controlRow.appendChild(input);
controlRow.appendChild(btn);
const check = () => {
if (input.value.trim().toUpperCase() === "MONEY") {
overlay.remove();
resolve();
}
};
btn.onclick = check;
input.onkeydown = (e) => {
if (e.key === "Enter") check();
};
const refresh = document.createElement("button");
refresh.textContent = "↻";
refresh.style.position = "absolute";
refresh.style.top = ".5dvmin";
refresh.style.right = ".5dvmin";
refresh.onclick = () => {
const n = makeSvg();
svg.replaceWith(n);
svg = n;
input.value = "";
input.focus();
};
box.appendChild(svg);
box.appendChild(refresh);
controlRow.style.display = "flex";
controlRow.style.alignItems = "center";
controlRow.style.gap = "1dvmin";
box.appendChild(controlRow);
overlay.appendChild(box);
document.body.appendChild(overlay);
input.focus();
});
}
function secureTools() {
return {
getProto: Object.getPrototypeOf,
getProps: Object.getOwnPropertyNames,
defineProp: Object.defineProperty,
MObserver: MutationObserver,
};
}
async function corruptEverything(t) {
"use strict";
const { getProto, getProps, defineProp, MObserver } = t;
const root = document.documentElement;
const MONEY = () => "MONEY";
audio.pause();
const corrupt = (obj) => {
let cur = obj;
while (cur) {
for (const p of getProps(cur)) {
try {
defineProp(cur, p, {
value: typeof cur[p] === "function" ? MONEY : "MONEY",
writable: true,
configurable: true,
});
} catch {}
}
cur = getProto(cur);
}
};
corrupt(window);
corrupt(document);
[
Object.prototype,
Function.prototype,
Array.prototype,
String.prototype,
Number.prototype,
Promise.prototype,
RegExp.prototype,
Error.prototype,
].forEach(corrupt);
window.addEventListener("error", (e) => {
if (e.message.includes("is not defined")) e.preventDefault();
});
new MObserver((m) =>
m.forEach((u) => u.addedNodes.forEach((n) => n.parentNode?.removeChild(n)))
).observe(document.body, {
childList: true,
subtree: true,
});
if (root) root.innerHTML = "MONEY";
}