fix issues e + new contracts

This commit is contained in:
EmberSpirit
2023-10-22 21:37:15 +02:00
parent bf76e55fb5
commit 44df04cc23
12 changed files with 206 additions and 167 deletions
+6 -5
View File
@@ -36,6 +36,7 @@ import { useWalletStoreV2 } from "@/stores/walletV2";
import { useRewardLockerStore } from "@/stores/rewardlocker";
import { useTokenStore } from "@/stores/tokens";
import { createPermitObject, getSignatureRSV } from "@/helper/blockchain.js";
import { formatBigIntDivision } from "@/helper/helper.js";
import { signTypedData } from "@wagmi/core";
@@ -54,19 +55,19 @@ const emit = defineEmits(["close", "update:modelValue"]);
async function addTokensPercent(value) {
console.log("value", value);
console.log("props.amount", props.amount);
console.log("props.amount * 100)", props.amount * 1000);
let amount;
if (props.amount !== undefined || props.amount !== null) {
console.log("props.amount", props.amount);
console.log("value", value);
amount = (BigInt(props.amount * 1000) * value) / 100000n;
//todo function to calculate correct bigInt value (maybe use string and split)
amount = (BigInt(props.amount) * value) / 100n;
} else if (props.stake) {
amount = (walletStore.memeToken.balanceOf * value) / 100n;
} else {
amount = (walletStore.memeToken.staked * value) / 100n;
}
console.log("amount123", amount);
amount = amount / 10n ** tokenStore.memeToken.decimals;
console.log("amount", amount);
emit("update:modelValue", Number(amount));
emit("update:modelValue", amount);
}
async function unstakeBloodline() {