From 8630bc443c521f14ece8e3676b0636ed28adfd60 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 29 Dec 2022 01:14:21 -0800 Subject: [PATCH] revamping map --- src/abi/main.json | 13 ++++++++++ src/styles/sections.css | 7 +++--- src/template/Sections.jsx | 51 ++++++++++++++++++++++++++------------- 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/src/abi/main.json b/src/abi/main.json index c1d863d..77f4317 100644 --- a/src/abi/main.json +++ b/src/abi/main.json @@ -81,6 +81,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "bombsExploded", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/src/styles/sections.css b/src/styles/sections.css index aa5ce82..ad90ad7 100644 --- a/src/styles/sections.css +++ b/src/styles/sections.css @@ -87,12 +87,11 @@ } .dots { - width: 10px; - height: 10px; + width: 6px; + height: 6px; position: absolute; - background-color: red; border-radius: 50%; - filter: drop-shadow(0 0 4px crimson); + filter: drop-shadow(0 0 4px rgb(255, 230, 0, .5)); animation: pulse .75s ease-out infinite alternate; } diff --git a/src/template/Sections.jsx b/src/template/Sections.jsx index 3bf6815..e0aedde 100644 --- a/src/template/Sections.jsx +++ b/src/template/Sections.jsx @@ -90,7 +90,7 @@ class GenerateBombOverlay extends React.Component { } render() { - return this.state.coords.map((obj) =>
) + return this.state.coords.map((obj) =>
) } } @@ -104,6 +104,8 @@ export function Section3() { const [bombBalance, setBombBalance] = useState(0); const [bombSupply, setBombSupply] = useState(0); const [boomerSupply, setBoomerSupply] = useState(0); + const [bombExploded, setBombExploded] = useState(0); + const [boomerKillCount, setBoomerKillCount] = useState(0); const { isConnected, address } = useAccount(); useContractReads({ contracts: [ @@ -144,10 +146,22 @@ export function Section3() { abi: MainABI, enabled: isConnected, functionName: 'bombSupply' + }, + { + address: contractAddress, + abi: MainABI, + enabled: isConnected, + functionName: 'bombsExploded' + }, + { + address: contractAddress, + abi: MainABI, + enabled: isConnected, + functionName: 'boomerKillCount' } ], watch: true, - cacheTime: 4_000, + cacheTime: 5000, onSuccess(data) { setBoomerPrice(data[0].toString()); setBombPrice(data[1].toString()); @@ -155,6 +169,8 @@ export function Section3() { setBombBalance(data[3].toString()); setBoomerSupply(data[4].toString()); setBombSupply(data[5].toString()); + setBombExploded(data[6].toString()); + setBoomerKillCount(data[7].toString()); } }); const radicalizeBoomersPrepare = usePrepareContractWrite({ @@ -181,6 +197,14 @@ export function Section3() { } }); const assembleBombsWrite = useContractWrite(assembleBombsPrepare.config); + const sendBombsPrepare = usePrepareContractWrite({ + address: contractAddress, + abi: MainABI, + enabled: isConnected, + functionName: 'sendBombs', + args: [sendBombAmount] + }); + const sendBombsWrite = useContractWrite(sendBombsPrepare.config); return (
{isConnected && @@ -195,10 +219,7 @@ export function Section3() { {radicalizeBoomersWrite.isLoading && <>minting {boomerAmount} || <>mint {boomerAmount} ({ethers.utils.formatEther((boomerPrice * boomerAmount).toString())} Ξ)}

- debounce(setBoomerAmount(v), 500)} /> + debounce(setBoomerAmount(v), 500)} />

Assemble Bombs

@@ -210,29 +231,25 @@ export function Section3() { {assembleBombsWrite.isLoading && <>minting {bombAmount} || <>mint {bombAmount} ({ethers.utils.formatEther((bombPrice * bombAmount).toString())} Ξ)}

- setBombAmount(v)} /> + setBombAmount(v)} />

Send Bombs

Sending bombs will burn your BOMB token and kill a BOOMR token at random. Be careful not to kill yourself in the process.

-

There are {boomerSupply} BOOMR available to kill

+

There are {boomerSupply - boomerKillCount} BOOMR available to kill

- + sendBombsWrite.write?.()}> send {sendBombAmount} (~0 Ξ)

- setSendBombAmount(v)} /> + setSendBombAmount(v)} />
- + + +
||