|
|
@ -1,6 +1,6 @@
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import { ethers, BigNumber } from 'ethers';
|
|
|
|
import { ethers, BigNumber } from 'ethers';
|
|
|
|
import { useAccount, useContractReads, usePrepareContractWrite, useContractWrite } from 'wagmi';
|
|
|
|
import { useAccount, useContractReads, usePrepareContractWrite, useContractWrite, useTransaction } from 'wagmi';
|
|
|
|
import Typewriter from 'react-ts-typewriter';
|
|
|
|
import Typewriter from 'react-ts-typewriter';
|
|
|
|
import Slider from 'rc-slider';
|
|
|
|
import Slider from 'rc-slider';
|
|
|
|
import { Parallax } from 'react-parallax';
|
|
|
|
import { Parallax } from 'react-parallax';
|
|
|
@ -180,7 +180,9 @@ function Section3() {
|
|
|
|
unaboomerSupply: 0,
|
|
|
|
unaboomerSupply: 0,
|
|
|
|
bombSupply: 0,
|
|
|
|
bombSupply: 0,
|
|
|
|
bombsExploded: 0,
|
|
|
|
bombsExploded: 0,
|
|
|
|
unaboomersKilled: 0
|
|
|
|
unaboomersKilled: 0,
|
|
|
|
|
|
|
|
results: [],
|
|
|
|
|
|
|
|
tokensKilled: []
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const handleStateChange = (obj) =>{
|
|
|
|
const handleStateChange = (obj) =>{
|
|
|
|
setOptions(preState => ({...preState , ...obj}))
|
|
|
|
setOptions(preState => ({...preState , ...obj}))
|
|
|
@ -286,6 +288,17 @@ function Section3() {
|
|
|
|
args: [options.sendBombAmount]
|
|
|
|
args: [options.sendBombAmount]
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const sendBombsWrite = useContractWrite(sendBombsPrepare.config);
|
|
|
|
const sendBombsWrite = useContractWrite(sendBombsPrepare.config);
|
|
|
|
|
|
|
|
const { data: tx } = useTransaction({ ...sendBombsWrite.data, enabled: sendBombsWrite.isSuccess });
|
|
|
|
|
|
|
|
if (tx) {
|
|
|
|
|
|
|
|
// let r;
|
|
|
|
|
|
|
|
const iface = new ethers.utils.Interface(MainABI);
|
|
|
|
|
|
|
|
console.log(tx)
|
|
|
|
|
|
|
|
// let txRes = iface.decodeFunctionResult("sendBombs", tx.data);
|
|
|
|
|
|
|
|
// console.log(txRes)
|
|
|
|
|
|
|
|
// const {0: results, 1: tokensKilled} = txRes.functionFragment.outputs;
|
|
|
|
|
|
|
|
// console.log(results);
|
|
|
|
|
|
|
|
// console.log(tokensKilled);
|
|
|
|
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<section className="section" id="mintSection">
|
|
|
|
<section className="section" id="mintSection">
|
|
|
|
{isConnected &&
|
|
|
|
{isConnected &&
|
|
|
|