diff --git a/src/template/Sections.jsx b/src/template/Sections.jsx
index 16fa489..d990d20 100644
--- a/src/template/Sections.jsx
+++ b/src/template/Sections.jsx
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
-import { ethers } from 'ethers';
+import { ethers, BigNumber } from 'ethers';
import { useAccount, useContractReads, usePrepareContractWrite, useContractWrite } from 'wagmi';
import Typewriter from 'react-ts-typewriter';
import Slider from 'rc-slider';
@@ -102,14 +102,38 @@ export function Section3() {
args: [address]
}
],
+ watch: true,
onSuccess(data) {
setBoomerPrice(data[0].toString());
setBombPrice(data[1].toString());
setBoomerBalance(data[2].toString());
setBombBalance(data[3].toString());
}
-
});
+ const radicalizeBoomersPrepare = usePrepareContractWrite({
+ address: contractAddress,
+ abi: MainABI,
+ enabled: isConnected,
+ functionName: 'radicalizeBoomers',
+ args: [boomerAmount],
+ overrides: {
+ from: address,
+ value: BigNumber.from((boomerPrice * boomerAmount).toString())
+ }
+ });
+ const radicalizeBoomersWrite = useContractWrite(radicalizeBoomersPrepare.config);
+ const assembleBombsPrepare = usePrepareContractWrite({
+ address: contractAddress,
+ abi: MainABI,
+ enabled: isConnected,
+ functionName: 'assembleBombs',
+ args: [bombAmount],
+ overrides: {
+ from: address,
+ value: BigNumber.from((bombPrice * bombAmount).toString())
+ }
+ });
+ const assembleBombsWrite = useContractWrite(assembleBombsPrepare.config);
return (
You have {boomerBalance} BOOMR
-
-