comments + contract update +
smaller design issues
This commit is contained in:
+13
-49
@@ -4,7 +4,7 @@ import { useTokenStore } from "@/stores/tokens";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useUniswapStore } from "@/stores/uniswap";
|
||||
import { useRoundsStore } from "@/stores/rounds";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
@@ -13,19 +13,11 @@ import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
||||
import {
|
||||
createConfig,
|
||||
configureChains,
|
||||
getAccount,
|
||||
getNetwork,
|
||||
getContract,
|
||||
connect,
|
||||
disconnect,
|
||||
watchAccount,
|
||||
watchWalletClient,
|
||||
watchPublicClient,
|
||||
watchContractEvent,
|
||||
watchNetwork,
|
||||
getWalletClient,
|
||||
fetchBalance,
|
||||
multicall,
|
||||
} from "@wagmi/core";
|
||||
import { WalletConnectConnector } from "@wagmi/core/connectors/walletConnect";
|
||||
import { MetaMaskConnector } from "@wagmi/core/connectors/metaMask";
|
||||
@@ -86,7 +78,9 @@ app.use(pinia);
|
||||
|
||||
|
||||
|
||||
app.use(Toast, {});
|
||||
app.use(Toast, {
|
||||
transition: "Vue-Toastification__fade",
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
@@ -94,7 +88,7 @@ try {
|
||||
const tokenStore = useTokenStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const roundsStore = useRoundsStore();
|
||||
const cycleStore = useCycleStore();
|
||||
const uniswapStore = useUniswapStore();
|
||||
|
||||
const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
||||
@@ -135,25 +129,6 @@ try {
|
||||
});
|
||||
walletStore.publicClient = publicClient;
|
||||
|
||||
const networkId = getNetwork()?.chain?.id;
|
||||
|
||||
// watchWalletClient(
|
||||
// {
|
||||
// chainId: networkId,
|
||||
// },
|
||||
// async (walletClient) => {
|
||||
// console.log("watchWalletClient", walletClient);
|
||||
// walletStore.walletClient = walletClient;
|
||||
// }
|
||||
// );
|
||||
|
||||
// watchPublicClient(
|
||||
// {
|
||||
// chainId: networkId,
|
||||
// },
|
||||
// (publicClient) => console.log("publicClient", publicClient)
|
||||
// );
|
||||
|
||||
watchContractEvent(
|
||||
{
|
||||
address: memeBurnerStore.config.contractAddress,
|
||||
@@ -163,7 +138,7 @@ try {
|
||||
async (log) => {
|
||||
console.log("memeSacrificedEvent", log);
|
||||
const token = log[0].args.sacrificedToken;
|
||||
await roundsStore.updateCurrentRound(token);
|
||||
await cycleStore.updateCurrentCycle(token);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -171,13 +146,13 @@ try {
|
||||
{
|
||||
address: rewardLockerStore.config.contractAddress,
|
||||
abi: rewardLockerStore.config.abi,
|
||||
eventName: "RoundCompleted",
|
||||
eventName: "CycleCompleted",
|
||||
},
|
||||
async (log) => {
|
||||
console.log("roundCompleted", log);
|
||||
await roundsStore.fillRound(roundsStore.currentRound);
|
||||
roundsStore.currentRound++;
|
||||
await roundsStore.fillRound(roundsStore.currentRound);
|
||||
console.log("CycleCompleted", log);
|
||||
await cycleStore.fillCycle(cycleStore.currentCycle);
|
||||
cycleStore.currentCycle++;
|
||||
await cycleStore.fillCycle(cycleStore.currentCycle);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -203,7 +178,8 @@ try {
|
||||
await memeBurnerStore.init();
|
||||
await tokenStore.initV2();
|
||||
await rewardLockerStore.init();
|
||||
await walletStore.loadWalletData();
|
||||
await walletStore.loadWalletData();
|
||||
await cycleStore.fillCycle(cycleStore.currentCycle);
|
||||
await uniswapStore.init();
|
||||
} else {
|
||||
walletStore.address = null;
|
||||
@@ -218,18 +194,6 @@ try {
|
||||
}
|
||||
});
|
||||
|
||||
// watchContractEvent(
|
||||
// {
|
||||
// address: memeBurnerStore.config.contractAddress,
|
||||
// abi: memeBurnerStore.config.abi,
|
||||
// eventName: "MemeSacrificed",
|
||||
// },
|
||||
// async (log) => {
|
||||
// console.log("memeSacrificedEvent", log);
|
||||
// const token = log[0].args.sacrificedToken;
|
||||
// await roundsStore.updateCurrentRound(token);
|
||||
// }
|
||||
// );
|
||||
|
||||
await walletStore.init();
|
||||
await tokenStore.initV2();
|
||||
|
||||
Reference in New Issue
Block a user