Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2f8b90cdd | ||
|
|
a719ee5989 | ||
|
|
5e6f373293 | ||
|
|
0b9e14c628 | ||
|
|
32ababbb39 | ||
|
|
fedcd0314d | ||
|
|
9eabba9c11 | ||
|
|
d25ef5ad63 | ||
|
|
fe44a619d4 | ||
|
|
320cbb5c63 | ||
|
|
2d35457076 | ||
|
|
dad9fd4fe6 | ||
|
|
d761adef18 | ||
|
|
1fb59225e3 | ||
|
|
b3191f493b | ||
|
|
35f2f0782f | ||
|
|
301c569edc | ||
|
|
a34de54d60 | ||
|
|
2b4405579e | ||
|
|
b5c6f8af33 | ||
|
|
68cd720c59 | ||
|
|
5c7e176457 | ||
|
|
18d14f1478 | ||
|
|
8d8423b1cb | ||
|
|
2965cbe065 | ||
|
|
e33c59d621 | ||
|
|
2445bb1f78 | ||
|
|
ea60d365d5 | ||
|
|
dd7a0a113d | ||
|
|
2f712d41d6 | ||
|
|
64d46693ea | ||
|
|
3d53d9e7c8 | ||
|
|
5c7053c0d9 | ||
|
|
1b2ea9b2a2 | ||
|
|
9330168af2 | ||
|
|
02182c8128 | ||
|
|
ca243064f7 | ||
|
|
0ff38abfb4 | ||
|
|
a0aafaddf0 | ||
|
|
44173a36e1 | ||
|
|
dfd208e075 | ||
|
|
cd773e16c9 | ||
|
|
c8f7c7cd5e | ||
|
|
034cc10f06 | ||
|
|
904df8ac7d | ||
|
|
1925a2d8af | ||
|
|
23100d9a2a | ||
|
|
7d33f225ce | ||
|
|
641755201e | ||
|
|
a77cf3a668 | ||
|
|
ceac2a1083 | ||
|
|
6c4933a6a8 | ||
|
|
2555217641 | ||
|
|
259ddec9ec | ||
|
|
c160b1c836 | ||
|
|
8ae8f9a64a | ||
|
|
b7a54f2cdd | ||
|
|
650df134d2 | ||
|
|
5157308745 | ||
|
|
0bab85fe75 | ||
|
|
34a445eaa3 | ||
|
|
e200b82697 | ||
|
|
bf3a606879 | ||
|
|
b2121a1ca4 | ||
|
|
22bce3d4be | ||
|
|
50bf3c81a6 | ||
|
|
716c0accc6 | ||
|
|
9dbb4d723d | ||
|
|
bac13aef42 | ||
|
|
feb841c17b | ||
|
|
9cbfd30a87 | ||
|
|
87e7937f0e | ||
|
|
9191df9c3b | ||
|
|
07dd95b38a | ||
|
|
5d15fe7567 | ||
|
|
67a86f8c26 | ||
|
|
601e7d98a0 | ||
|
|
5a21bb0fd3 | ||
|
|
cdd142ded0 | ||
|
|
9c409550e7 | ||
|
|
13021bf691 | ||
|
|
161262f590 | ||
|
|
24d91353b9 | ||
|
|
994c440e2f | ||
|
|
cb85a47a94 |
@@ -27,3 +27,6 @@ coverage
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# we want to force specific versions of dependencies to prevent malware injections
|
||||
# yarn.lock
|
||||
@@ -1,15 +1,3 @@
|
||||
# vue-ethereum2
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/assets/js/blockies.min.js"></script>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -13,15 +13,23 @@
|
||||
"@fortawesome/free-brands-svg-icons": "^6.4.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
||||
"@fortawesome/vue-fontawesome": "^3.0.3",
|
||||
"@wagmi/core": "^1.3.8",
|
||||
"abi-decoder": "^2.4.0",
|
||||
"blockies": "^0.0.2",
|
||||
"pinia": "^2.0.36",
|
||||
"pinia-plugin-persistedstate": "^3.1.0",
|
||||
"sass": "^1.62.1",
|
||||
"swiper": "^9.4.1",
|
||||
"viem": "^1.4.1",
|
||||
"vue": "^3.3.2",
|
||||
"vue-collapsed": "^1.2.8",
|
||||
"vue-router": "^4.2.0",
|
||||
"web3": "^1.7.1"
|
||||
"vue-toastification": "^2.0.0-rc.5",
|
||||
"vue3-lottie": "^3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
||||
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-plugin-vue": "^9.11.0",
|
||||
|
||||
|
After Width: | Height: | Size: 699 B |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,13 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_13571_129878)">
|
||||
<rect width="40" height="40" fill="#0052FF"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.3312 0H31.6672C36.2704 0 40 4.0128 40 8.9632V31.0368C40 35.9872 36.2704 40 31.6688 40H8.3312C3.7296 40 0 35.9872 0 31.0368V8.9632C0 4.0128 3.7296 0 8.3312 0Z" fill="#0052FF"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9989 5.79443C27.8453 5.79443 34.2053 12.1544 34.2053 20.0008C34.2053 27.8472 27.8453 34.2072 19.9989 34.2072C12.1525 34.2072 5.79254 27.8472 5.79254 20.0008C5.79254 12.1544 12.1525 5.79443 19.9989 5.79443Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5005 15.459H23.4973C24.0733 15.459 24.5389 15.9614 24.5389 16.579V23.419C24.5389 24.0382 24.0717 24.539 23.4973 24.539H16.5005C15.9245 24.539 15.4589 24.0366 15.4589 23.419V16.579C15.4589 15.9614 15.9261 15.459 16.5005 15.459Z" fill="#0052FF"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_13571_129878">
|
||||
<rect width="40" height="40" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,15 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="40" height="40" fill="#F7F9FB"/>
|
||||
<path d="M32.6877 6.6665L22.0555 14.5632L24.0216 9.90427L32.6877 6.6665Z" fill="#E2761B" stroke="#E2761B" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M8.1433 6.6665L18.6901 14.638L16.8201 9.90427L8.1433 6.6665ZM28.8628 24.9711L26.0311 29.3095L32.0899 30.9764L33.8317 25.0672L28.8628 24.9711ZM7.0213 25.0672L8.75238 30.9764L14.8112 29.3095L11.9795 24.9711L7.0213 25.0672Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M14.4697 17.641L12.7814 20.1949L18.7974 20.462L18.5837 13.9972L14.4697 17.641ZM26.3629 17.641L22.1955 13.9224L22.0565 20.462L28.0619 20.1949L26.3629 17.641ZM14.8117 29.3097L18.4234 27.5466L15.3032 25.1103L14.8117 29.3097ZM22.4092 27.5466L26.0316 29.3097L25.5294 25.1103L22.4092 27.5466Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M26.0316 29.3095L22.4091 27.5464L22.6976 29.9079L22.6656 30.9017L26.0316 29.3095ZM14.8116 29.3095L18.1776 30.9017L18.1562 29.9079L18.4233 27.5464L14.8116 29.3095Z" fill="#D7C1B3" stroke="#D7C1B3" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M18.2319 23.5497L15.2185 22.6628L17.345 21.6904L18.2319 23.5497ZM22.6023 23.5497L23.4892 21.6904L25.6264 22.6628L22.6023 23.5497Z" fill="#233447" stroke="#233447" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M14.8106 29.3092L15.3236 24.9708L11.9789 25.067L14.8106 29.3092ZM25.5177 24.9708L26.0306 29.3092L28.8623 25.067L25.5177 24.9708ZM28.0609 20.1943L22.0555 20.4615L22.6112 23.5496L23.4981 21.6903L25.6352 22.6627L28.0609 20.1943ZM15.2167 22.6627L17.3538 21.6903L18.2301 23.5496L18.7964 20.4615L12.7804 20.1943L15.2167 22.6627Z" fill="#CD6116" stroke="#CD6116" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M12.7814 20.1943L15.3032 25.1097L15.2177 22.6627L12.7814 20.1943ZM25.6362 22.6627L25.5294 25.1097L28.0619 20.1943L25.6362 22.6627ZM18.7974 20.4615L18.2311 23.5496L18.9363 27.1935L19.0966 22.3956L18.7974 20.4615ZM22.0565 20.4615L21.768 22.3849L21.8963 27.1935L22.6122 23.5496L22.0565 20.4615Z" fill="#E4751F" stroke="#E4751F" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M22.613 23.5495L21.8971 27.1933L22.41 27.546L25.5302 25.1096L25.637 22.6626L22.613 23.5495ZM15.2185 22.6626L15.304 25.1096L18.4242 27.546L18.9371 27.1933L18.2319 23.5495L15.2185 22.6626Z" fill="#F6851B" stroke="#F6851B" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M22.6656 30.9022L22.6976 29.9085L22.4305 29.6734H18.402L18.1562 29.9085L18.1776 30.9022L14.8116 29.3101L15.987 30.2718L18.3699 31.9281H22.4625L24.8561 30.2718L26.0316 29.3101L22.6656 30.9022Z" fill="#C0AD9E" stroke="#C0AD9E" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M22.409 27.5465L21.8961 27.1938H18.9362L18.4233 27.5465L18.1561 29.908L18.4019 29.6729H22.4304L22.6975 29.908L22.409 27.5465Z" fill="#161616" stroke="#161616" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M33.1371 15.0761L34.0454 10.7164L32.6883 6.6665L22.4087 14.2961L26.3624 17.6407L31.951 19.2756L33.1905 17.833L32.6562 17.4484L33.5111 16.6683L32.8486 16.1554L33.7034 15.5036L33.1371 15.0761ZM6.79688 10.7164L7.70516 15.0761L7.12813 15.5036L7.98299 16.1554L7.33116 16.6683L8.18601 17.4484L7.65173 17.833L8.88058 19.2756L14.4692 17.6407L18.4229 14.2961L8.14327 6.6665L6.79688 10.7164Z" fill="#763D16" stroke="#763D16" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M31.951 19.2761L26.3624 17.6412L28.0614 20.1951L25.5289 25.1105L28.8628 25.0678H33.8317L31.951 19.2761ZM14.4692 17.6412L8.88061 19.2761L7.0213 25.0678H11.9795L15.3027 25.1105L12.7809 20.1951L14.4692 17.6412ZM22.0561 20.4622L22.4087 14.2966L24.0329 9.90479H16.8201L18.4229 14.2966L18.7969 20.4622L18.9252 22.407L18.9358 27.1942H21.8958L21.9171 22.407L22.0561 20.4622Z" fill="#F6851B" stroke="#F6851B" stroke-width="0.106857" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1,5 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="40" height="40" fill="#3396FF"/>
|
||||
<path d="M20 40C31.0457 40 40 31.0457 40 20C40 8.9543 31.0457 0 20 0C8.9543 0 0 8.9543 0 20C0 31.0457 8.9543 40 20 40Z" fill="#3396FF"/>
|
||||
<path d="M12.2327 14.8836C16.5225 10.7003 23.4779 10.7003 27.7677 14.8836L28.284 15.3871C28.4985 15.5962 28.4985 15.9353 28.284 16.1445L26.5179 17.8668C26.4106 17.9713 26.2368 17.9713 26.1295 17.8668L25.419 17.1739C22.4263 14.2555 17.5741 14.2555 14.5813 17.1739L13.8204 17.9159C13.7132 18.0205 13.5393 18.0205 13.4321 17.9159L11.666 16.1936C11.4514 15.9845 11.4514 15.6453 11.666 15.4362L12.2327 14.8836ZM31.4203 18.4454L32.9922 19.9782C33.2067 20.1874 33.2067 20.5265 32.9922 20.7356L25.9045 27.6473C25.69 27.8565 25.3422 27.8565 25.1277 27.6473L20.0973 22.742C20.0437 22.6896 19.9568 22.6896 19.9031 22.742L14.8728 27.6473C14.6583 27.8565 14.3106 27.8565 14.096 27.6473L7.00816 20.7355C6.79367 20.5264 6.79367 20.1873 7.00816 19.9782L8.58004 18.4453C8.79454 18.2362 9.1423 18.2362 9.35679 18.4453L14.3873 23.3508C14.4409 23.4031 14.5278 23.4031 14.5814 23.3508L19.6117 18.4453C19.8262 18.2361 20.1739 18.2361 20.3885 18.4453L25.4189 23.3508C25.4726 23.4031 25.5595 23.4031 25.6131 23.3508L30.6436 18.4454C30.858 18.2362 31.2058 18.2362 31.4203 18.4454Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 798 B |
|
After Width: | Height: | Size: 492 B |
|
After Width: | Height: | Size: 428 B |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 230 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 963 B |
@@ -1,36 +1,55 @@
|
||||
<script setup>
|
||||
import { onMounted, onUnmounted, provide, ref } from "vue";
|
||||
import { onMounted, onUnmounted, provide, ref, watch } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import Web3 from "web3";
|
||||
import Navbar from "./components/Navbar.vue";
|
||||
import { useWalletStore } from "@/stores/wallet";
|
||||
const walletStore = useWalletStore();
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useContractStore } from "@/stores/contracts";
|
||||
import { useSacrificeStore } from "@/stores/sacrifice";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useMultiCallStore } from "@/stores/multicall";
|
||||
import { useRoundsStore } from "@/stores/rounds";
|
||||
const tokenStore = useTokenStore();
|
||||
const contractStore = useContractStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const multiCallStore = useMultiCallStore();
|
||||
const roundsStore = useRoundsStore();
|
||||
const { memeBurner, token } = storeToRefs(tokenStore);
|
||||
const { list } = storeToRefs(contractStore);
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
|
||||
import SlideoutPanel from "./components/SlideoutPanel.vue";
|
||||
import ConnectWallet from "./components/ConnectWallet.vue";
|
||||
import BloodSplash from "./components/BloodSplash.vue";
|
||||
import { getNetwork, fetchTransaction } from "@wagmi/core";
|
||||
|
||||
const isMobile = ref(false);
|
||||
const showPanel = ref(false);
|
||||
const splashBlood = ref(0);
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
isMobile.value = isMobileFunc();
|
||||
let subscription;
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener("resize", handleWindowSizeChange);
|
||||
});
|
||||
|
||||
watch(showPanel, (newValue, oldValue) => {
|
||||
console.log("document.body", document.body);
|
||||
if (newValue) {
|
||||
document.body.classList.add("sideoutpanel-open");
|
||||
if (isMobile) {
|
||||
document.body.classList.add("mobile");
|
||||
}
|
||||
} else {
|
||||
document.body.classList.remove("sideoutpanel-open");
|
||||
if (isMobile) {
|
||||
document.body.classList.remove("mobile");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const handleWindowSizeChange = () => {
|
||||
isMobile.value = isMobileFunc();
|
||||
// your code
|
||||
};
|
||||
|
||||
//to have mobile breakpoint not only on sass side
|
||||
function isMobileFunc() {
|
||||
if (screen.width <= 760) {
|
||||
return true;
|
||||
@@ -38,134 +57,213 @@ function isMobileFunc() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function changeRoute(name) {
|
||||
router.push({
|
||||
name: name,
|
||||
});
|
||||
}
|
||||
provide("isMobile", isMobile);
|
||||
provide("showPanel", showPanel);
|
||||
provide("splashBlood", splashBlood);
|
||||
|
||||
onMounted(async () => {
|
||||
window.addEventListener("resize", handleWindowSizeChange);
|
||||
handleWindowSizeChange();
|
||||
//more or less tests
|
||||
var test = await walletStore.isConnected();
|
||||
console.log("test", test);
|
||||
|
||||
let web3 = new Web3("https://eth-goerli.g.alchemy.com/v2/0-W9tOm6v_QP1PfRV8RuBCpWr-qoEbkN");
|
||||
let web3socket = new Web3(
|
||||
new Web3.providers.WebsocketProvider("wss://eth-goerli.g.alchemy.com/v2/0-W9tOm6v_QP1PfRV8RuBCpWr-qoEbkN")
|
||||
);
|
||||
console.log("web3socket", web3socket);
|
||||
|
||||
//init
|
||||
|
||||
walletStore.web3 = web3;
|
||||
// const contract = new web3.eth.Contract(memeBurner.value.config.abi, memeBurner.value.config.contractAddress);
|
||||
list.value.memeBurnerPublic = new web3.eth.Contract(
|
||||
memeBurner.value.config.abi,
|
||||
memeBurner.value.config.contractAddress
|
||||
);
|
||||
|
||||
//Memeburner Contract
|
||||
|
||||
// var testabc = await memeBurnerStore.contract.methods
|
||||
// .getSacrificedMeme(1, "0x4435ABC578136e2Eca50b5EFf950F17CAF42485b")
|
||||
// .call();
|
||||
// console.log("testabc", testabc);
|
||||
|
||||
// var data = await memeBurnerStore.getSacrificedRound(1);
|
||||
// console.log("data", data);
|
||||
// console.log("blub1", blub1);
|
||||
// console.log("blub2", blub2);
|
||||
// console.log("getSacrificedMeme", getSacrificedMeme1.amountAchieved);
|
||||
// console.log("getGoal", getGoal);
|
||||
// console.log("memeBurnerStore.contract", memeBurnerStore.contract);
|
||||
// console.log("list", list.value);
|
||||
// const rounds = await contract.methods.rounds("0x0e349D42C125acA39ea58024FFC23ED0fE5feE32").call();
|
||||
// console.log("rounds", rounds);
|
||||
|
||||
// var claim = await rewardLockerStore.getTotalRewardsOf("0x60dd9D0e015115b9aEf61bEDCcBE1390CEEfC247", [1]);
|
||||
// console.log("claim", claim);
|
||||
|
||||
// var lastCompletedRound = await rewardLockerStore.lastCompletedRound();
|
||||
// console.log("lastCompletedRound", lastCompletedRound);
|
||||
// var getwards = await rewardLockerStore.getRewards(
|
||||
// "0x60dd9D0e015115b9aEf61bEDCcBE1390CEEfC247",
|
||||
// 1,
|
||||
// "0x4435ABC578136e2Eca50b5EFf950F17CAF42485b"
|
||||
// );
|
||||
// console.log("getwards", getwards);
|
||||
|
||||
//contracts
|
||||
rewardLockerStore.contract = new web3.eth.Contract(
|
||||
rewardLockerStore.config.abi,
|
||||
rewardLockerStore.config.contractAddress
|
||||
);
|
||||
memeBurnerStore.contract = new web3.eth.Contract(
|
||||
memeBurnerStore.config.abi,
|
||||
memeBurnerStore.config.contractAddress
|
||||
);
|
||||
tokenStore.memeToken.contract = new web3.eth.Contract(
|
||||
tokenStore.memeToken.config.abi,
|
||||
tokenStore.memeToken.config.contractAddress
|
||||
);
|
||||
const websocketMemeBurner = new web3socket.eth.Contract(
|
||||
memeBurnerStore.config.abi,
|
||||
memeBurnerStore.config.contractAddress
|
||||
);
|
||||
multiCallStore.contract = new web3.eth.Contract(multiCallStore.config.abi, multiCallStore.config.contractAddress);
|
||||
|
||||
//init
|
||||
roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
|
||||
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
||||
roundsStore.activeRound = roundsStore.currentRound;
|
||||
await roundsStore.fillRound(roundsStore.activeRound);
|
||||
|
||||
tokenStore.memeToken.decimals = parseInt(await tokenStore.memeToken.contract.methods.decimals().call());
|
||||
for (let index = 0; index < token.value.length; index++) {
|
||||
const _token = token.value[index];
|
||||
_token.contract = new web3.eth.Contract(_token.abi, _token.contractAddress);
|
||||
_token.decimals = parseInt(await _token.contract.methods.decimals().call());
|
||||
console.log("beforeEach");
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const cycleStore = useCycleStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
walletStore.initialized = true;
|
||||
console.log("init router");
|
||||
//check if it is necessary
|
||||
if (!cycleStore.currentCycle) {
|
||||
cycleStore.currentCycle = parseInt(await memeBurnerStore.getCurrentCycle());
|
||||
console.log("cycleStore.currentCycle", cycleStore.currentCycle);
|
||||
cycleStore.activeCycle = cycleStore.currentCycle;
|
||||
}
|
||||
|
||||
console.log("token123", token.value);
|
||||
|
||||
//events
|
||||
// var bleb = roundsStore.rounds[roundsStore.currentRound].find(
|
||||
// (obj) => obj.contractAddress === "0x4435ABC578136e2Eca50b5EFf950F17CAF42485b"
|
||||
// );
|
||||
// console.log("roundsStore.rounds[roundsStore.currentRound]", bleb);
|
||||
websocketMemeBurner.events
|
||||
.MemeSacrificed()
|
||||
.on("data", async (event) => {
|
||||
console.log("sacrificedAmount", event.returnValues.sacrificedAmount);
|
||||
console.log("sacrificedToken", event.returnValues.sacrificedToken);
|
||||
await roundsStore.updateCurrentRound(
|
||||
event.returnValues.sacrificedToken,
|
||||
event.returnValues.sacrificedAmount
|
||||
);
|
||||
})
|
||||
.on("error", (error) => console.log("MemeSacrificederror", error));
|
||||
console.log("cycleStore.activeCycle", cycleStore.activeCycle);
|
||||
await cycleStore.fillCycle(cycleStore.activeCycle);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<navbar />
|
||||
<div class="main">
|
||||
<navbar @show-panel="(value) => (showPanel = value)" />
|
||||
<slideout-panel v-model="showPanel">
|
||||
<connect-wallet></connect-wallet>
|
||||
</slideout-panel>
|
||||
<div class="main" :class="{ 'no-scroll': showPanel, mobile: isMobile }">
|
||||
<RouterView />
|
||||
</div>
|
||||
<blood-splash :key="splashBlood"></blood-splash>
|
||||
|
||||
<div class="footer">
|
||||
<div class="footer-inner">
|
||||
$BLOOD is 100%<br />
|
||||
community owned.<br />
|
||||
No team %, no pre-mine.
|
||||
<div class="footer-headline">Join Bloodline</div>
|
||||
|
||||
<div class="footer-social-links">
|
||||
<div class="social-bloodline-badge">
|
||||
<div class="social-bloodline-badge-icon">
|
||||
<font-awesome-icon icon="fa-brands fa-discord" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="social-bloodline-badge">
|
||||
<div class="social-bloodline-badge-icon">
|
||||
<font-awesome-icon icon="fa-brands fa-telegram" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="social-bloodline-badge">
|
||||
<div class="social-bloodline-badge-icon">
|
||||
<font-awesome-icon icon="fa-brands fa-twitter" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mobile-navigation-bar" v-if="isMobile">
|
||||
<div @click="changeRoute('home')" :class="{ active: route.name === 'home' }">
|
||||
<font-awesome-icon icon="fa-droplet" />
|
||||
</div>
|
||||
<div @click="changeRoute('cycle')" :class="{ active: route.name === 'cycle' }">
|
||||
<font-awesome-icon icon="fa-moon" />
|
||||
</div>
|
||||
<div @click="changeRoute('profile')" :class="{ active: route.name === 'profile' }">
|
||||
<font-awesome-icon icon="fa-person" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="sass">
|
||||
|
||||
.footer
|
||||
height: 450px
|
||||
min-height: 450px
|
||||
background-color: var(--grey2)
|
||||
height: auto
|
||||
background-color: var(--midnight-black)
|
||||
@media (min-width: 992px)
|
||||
height: 150px
|
||||
min-height: 150px
|
||||
display: flex
|
||||
flex-direction: column
|
||||
justify-content: center
|
||||
.footer-inner
|
||||
padding: 24px
|
||||
padding: 16px 0 24px 0
|
||||
font-size: 24px
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 16px
|
||||
align-items: center
|
||||
@media (min-width: 992px)
|
||||
justify-content: center
|
||||
.footer-headline
|
||||
font-size: 16px
|
||||
.footer-social-links
|
||||
display: flex
|
||||
gap: 24px
|
||||
.social-bloodline-badge
|
||||
border-radius: 14px
|
||||
background: var(--grey, #858585)
|
||||
display: flex
|
||||
padding: 6px 20px
|
||||
align-items: center
|
||||
flex: 0 1 0
|
||||
color: black
|
||||
&:hover,&:active,&:focus
|
||||
background-color: lighten( #858585, 10%)
|
||||
cursor: pointer
|
||||
.social-bloodline-badge-icon
|
||||
font-size: 16px
|
||||
.main
|
||||
// padding-top: 24px
|
||||
margin-top: 82px
|
||||
padding: 24px 0
|
||||
@media (min-width: 992px)
|
||||
margin-top: 80px
|
||||
padding: 80px 0
|
||||
&.mobile
|
||||
&.no-scroll
|
||||
overflow: hidden
|
||||
|
||||
|
||||
.mobile-navigation-bar
|
||||
height: 72px
|
||||
z-index: 1
|
||||
width: 100%
|
||||
padding: 16px 48px
|
||||
border-radius: 16px 16px 0px 0px
|
||||
box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.25)
|
||||
background: var(--midnight-black, #0F0F0F)
|
||||
bottom: -1px
|
||||
position: fixed
|
||||
display: flex
|
||||
justify-content: space-around
|
||||
align-items: center
|
||||
div
|
||||
font-size: 40px
|
||||
cursor: pointer
|
||||
&.active
|
||||
color: var(--purple)
|
||||
|
||||
.modal-overlay
|
||||
background-color: rgb(15, 15, 15, 0.7)
|
||||
height: 100vh
|
||||
width: 100vw
|
||||
position: fixed
|
||||
left: 0
|
||||
bottom: 0
|
||||
z-index: 10
|
||||
@media (min-width: 992px)
|
||||
background-color: unset
|
||||
.modal-card
|
||||
border-radius: 16px
|
||||
padding: 16px
|
||||
width: 342px
|
||||
text-align: center
|
||||
position: absolute
|
||||
top: 50%
|
||||
left: 50%
|
||||
transform: translate(-50%, -50%)
|
||||
border: 2px solid var(--dark-purple, #4B0082)
|
||||
background: var(--midnight-black, #0F0F0F)
|
||||
z-index: 100
|
||||
gap: 16px
|
||||
@media (min-width: 992px)
|
||||
top: 142px
|
||||
right: 24px
|
||||
left: unset
|
||||
transform: unset
|
||||
.body
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
.amount-number
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-items: end
|
||||
gap: 8px
|
||||
img
|
||||
width: 74px
|
||||
height: 74px
|
||||
|
||||
body::-webkit-scrollbar
|
||||
width: 10px
|
||||
|
||||
body::-webkit-scrollbar-track
|
||||
background: #202020
|
||||
|
||||
body::-webkit-scrollbar-thumb
|
||||
background: grey
|
||||
|
||||
body:hover::-webkit-scrollbar-thumb
|
||||
background: grey
|
||||
|
||||
|
||||
.toast-header, .toast-body
|
||||
font-size: 16px
|
||||
|
||||
.Vue-Toastification__container
|
||||
&.bloodline-toast-container
|
||||
&.top-right
|
||||
@media (min-width: 992px)
|
||||
top: 100px
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"contractName": "MemeToken",
|
||||
"contractAddress": "0x7D3e23Efa01745709b2123C4D17bcab86cBc55D1",
|
||||
"contractName": "Bloodline",
|
||||
"contractAddress": "0x51bF3df58D123e8EA43fb2189f18027FD36a08Af",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -172,7 +172,13 @@
|
||||
}
|
||||
],
|
||||
"name": "burn",
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
@@ -202,7 +208,7 @@
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "mintMemeToken",
|
||||
"name": "mintBloodline",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"contractName": "LiquidityOwner",
|
||||
"contractAddress": "0x2Cdea6EA15303b1744F05f62E6921479D31AcBC9",
|
||||
"contractAddress": "0xF8bc4Ce13263DD4e12070e3192be50310eF7C95a",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_memeToken",
|
||||
"name": "_bloodline",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
@@ -21,270 +21,95 @@
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_nfPositionManager",
|
||||
"name": "_memeAltar",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_memeBurner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_chunk",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "CallbackCanBeCalledOnlyByPool",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "CurrentPriceDisallowsToProvide",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NothingToProvide",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "OnlyMemeAltar",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "ProjectAlive",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "WrongSideOfPrice",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "int24",
|
||||
"name": "_tickLower",
|
||||
"name": "tickLower",
|
||||
"type": "int24"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "int24",
|
||||
"name": "_tickUpper",
|
||||
"name": "tickUpper",
|
||||
"type": "int24"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountMemeToken",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "amountWETH",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "addNewPosition",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "chunk",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
"name": "LiquidityProvided",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "liquidityTokenIds",
|
||||
"type": "uint256[]"
|
||||
}
|
||||
],
|
||||
"name": "collectDeveloperFees",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount0",
|
||||
"type": "uint256"
|
||||
"indexed": true,
|
||||
"internalType": "int24",
|
||||
"name": "tickLower",
|
||||
"type": "int24"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount1",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "currentTokenIdToFill",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "tokenId",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "liquidity",
|
||||
"type": "uint128"
|
||||
}
|
||||
],
|
||||
"name": "decreasePositionLiquidity",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount0",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount1",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "tokenId",
|
||||
"type": "uint256"
|
||||
"indexed": true,
|
||||
"internalType": "int24",
|
||||
"name": "tickUpper",
|
||||
"type": "int24"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "amountWETH",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountMemeToken",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "increasePositionLiquidity",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "memeBurner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "memeToken",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
"name": "LiquidityShouldBeProvidedLater",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "positionsToCancel",
|
||||
"type": "uint256[]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountOfWETHToUse",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "movePriceUP",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount0Collected",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount1Collected",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "nfPositionManager",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract INonfungiblePositionManager",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"name": "onERC721Received",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes4",
|
||||
"name": "",
|
||||
"type": "bytes4"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "positions",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "liquidity",
|
||||
"type": "uint128"
|
||||
},
|
||||
{
|
||||
"internalType": "int24",
|
||||
"name": "tickLower",
|
||||
@@ -296,36 +121,36 @@
|
||||
"type": "int24"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "round1",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "provideLiquidity",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "tokenIds",
|
||||
"name": "_concatenateTicks",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"internalType": "int48",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
"type": "int48"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "int48",
|
||||
"name": "",
|
||||
"type": "int48"
|
||||
}
|
||||
],
|
||||
"name": "_positions",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "providedETH",
|
||||
"type": "uint112"
|
||||
},
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "unprovidedETH",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
@@ -333,7 +158,7 @@
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "uniV3Pool",
|
||||
"name": "bloodline",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
@@ -347,22 +172,200 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "int256",
|
||||
"name": "amount0Delta",
|
||||
"type": "int256"
|
||||
"internalType": "int24",
|
||||
"name": "tickLower",
|
||||
"type": "int24"
|
||||
},
|
||||
{
|
||||
"internalType": "int256",
|
||||
"name": "amount1Delta",
|
||||
"type": "int256"
|
||||
"internalType": "int24",
|
||||
"name": "tickUpper",
|
||||
"type": "int24"
|
||||
}
|
||||
],
|
||||
"name": "collectPositionFees",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "wethAmount",
|
||||
"type": "uint128"
|
||||
},
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "bloodlineAmount",
|
||||
"type": "uint128"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "collectedEthTotal",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "memeAltar",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "developerFee",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "payDeveloperFee",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "uniswapPool",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "extraAmount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "payWETHToUniswapPool",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "pool",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract IUniswapV3Pool",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "previousBDLTotalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "",
|
||||
"type": "uint128"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "collectedEthInCycle",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"name": "provideLiquidity",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "issuancePrice",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "int24",
|
||||
"name": "tickLower",
|
||||
"type": "int24"
|
||||
},
|
||||
{
|
||||
"internalType": "int24",
|
||||
"name": "tickUpper",
|
||||
"type": "int24"
|
||||
}
|
||||
],
|
||||
"name": "provideUnprovidedLiquidity",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "int24",
|
||||
"name": "tickLower",
|
||||
"type": "int24"
|
||||
},
|
||||
{
|
||||
"internalType": "int24",
|
||||
"name": "tickUpper",
|
||||
"type": "int24"
|
||||
}
|
||||
],
|
||||
"name": "rageQuit",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "wethAmount",
|
||||
"type": "uint128"
|
||||
},
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "bloodlineAmount",
|
||||
"type": "uint128"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount0Owed",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount1Owed",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "_data",
|
||||
"name": "",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"name": "uniswapV3SwapCallback",
|
||||
"name": "uniswapV3MintCallback",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
@@ -379,10 +382,6 @@
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"stateMutability": "payable",
|
||||
"type": "receive"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,368 @@
|
||||
{
|
||||
"contractName": "Meme",
|
||||
"contractAddress": "0xC99B9d1693b71eF503c86B4cC05f141714176E5b",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "symbol",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_weth",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_uniV2Factory",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DOMAIN_SEPARATOR",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "approve",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "balanceOf",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "burn",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "decimals",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "mint",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "nonces",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "deadline",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "v",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "r",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "s",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "permit",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transfer",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "uniV2Pool",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
{
|
||||
"contractName": "Meme",
|
||||
"contractAddress": "0xBCf48173f0767465Ef22fcDe2e1a099C8A5B4712",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "symbol",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_weth",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_uniV2Factory",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DOMAIN_SEPARATOR",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "approve",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "balanceOf",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "burn",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "decimals",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "mint",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "nonces",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "deadline",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "v",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "r",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "s",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "permit",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transfer",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "uniV2Pool",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
{
|
||||
"contractName": "Meme",
|
||||
"contractAddress": "0xD563C6d061c5fc09eCf94c6Ce30CB400Ce2FD295",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "symbol",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_weth",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_uniV2Factory",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DOMAIN_SEPARATOR",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "approve",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "balanceOf",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "burn",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "decimals",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "mint",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "nonces",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "deadline",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "v",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "r",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "s",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "permit",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transfer",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "uniV2Pool",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,920 @@
|
||||
{
|
||||
"contractName": "MemeAltar",
|
||||
"contractAddress": "0xE4F42F3f8B0E57b1054D457fe3b49a1A10B1aCEa",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "sacrificableList",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "uniV2pools",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_weth",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_admin",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_rewardLocker",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_bloodline",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "_defaultGoal",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "ArraysHaveDifferentLength",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "CycleCompletedRegistrationFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InsufficientOutputAmount",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LiquidityOwnerAlreadyInitialized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MemeIsNotInAList",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NextCycleRegistrationFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotAdmin",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotExactInput",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NothingToSacrifice",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "RewardRegistrationFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "SwapCallbackCanBeCalledOnlyByPool",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "SwapWithinZeroLiquidity",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "SwitchRequiresMemeBeSet",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TokenIsNotInSacrificableList",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TooLittleReceived",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "uniV2Pool",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "UniV2PoolWithoutLiquidity",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "memeMarket",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "MemeAddedToSacrificableList",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "MemeRemovedFromSacrificableList",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sacrificer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sacrificedToken",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "sacrificedAmount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "MemeSacrificed",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newAdmin",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "NewAdmin",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b1",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m1",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b2",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m2",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b3",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m4",
|
||||
"type": "uint40"
|
||||
}
|
||||
],
|
||||
"indexed": false,
|
||||
"internalType": "struct MemeAltar.BM",
|
||||
"name": "_bm",
|
||||
"type": "tuple"
|
||||
}
|
||||
],
|
||||
"name": "NewBM",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "newDurationLimit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "NewCycleDurationLimit",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "newDefaultGoal",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "NewDefaultCycleGoal",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "uniV2Pool",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addMemeToList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b1",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m1",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b2",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m2",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b3",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m4",
|
||||
"type": "uint40"
|
||||
}
|
||||
],
|
||||
"internalType": "struct MemeAltar.BM",
|
||||
"name": "newBM",
|
||||
"type": "tuple"
|
||||
}
|
||||
],
|
||||
"name": "adjustBM",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint32",
|
||||
"name": "newDurationLimit",
|
||||
"type": "uint32"
|
||||
}
|
||||
],
|
||||
"name": "adjustCycleDurationLimit",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "newDefaultGoal",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"name": "adjustDefaultGoal",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "admin",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "bloodline",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract Bloodline",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "bm",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b1",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m1",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b2",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m2",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "b3",
|
||||
"type": "uint40"
|
||||
},
|
||||
{
|
||||
"internalType": "uint40",
|
||||
"name": "m4",
|
||||
"type": "uint40"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "currentCycle",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "cycleDurationLimit",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint32",
|
||||
"name": "",
|
||||
"type": "uint32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"name": "cycles",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "goal",
|
||||
"type": "uint112"
|
||||
},
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "ethUsedToBuy",
|
||||
"type": "uint112"
|
||||
},
|
||||
{
|
||||
"internalType": "uint32",
|
||||
"name": "expirationTimestamp",
|
||||
"type": "uint32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "defaultGoal",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToSacrifice",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountToSacrifice",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "cycleParticipant",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "getAmountETHBase",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountETHBase",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountETHForSelling",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToSacrifice",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getAmountToReachGoal",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"name": "getGoalInBLOOD",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToSacrifice",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountToSacrifice",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "getRewardForSacrifice",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "rewardCurrentCycle",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "rewardNextCycle",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint112"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getSacrificedMeme",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "participation",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountAchieved",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "issuancePrice",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "liquidityOwner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "memeList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "memesUniV2Pools",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "removeMemeFromList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "rewardLocker",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToSacrifice",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountToSacrifice",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint112",
|
||||
"name": "minETH",
|
||||
"type": "uint112"
|
||||
}
|
||||
],
|
||||
"name": "sacrificeMeme",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint128",
|
||||
"name": "reward",
|
||||
"type": "uint128"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToSacrifice",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountToSacrifice",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "minBLOOD",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "sacrificeMemeAndBuyBLOOD",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "reward",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_liquidityOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setLiquidityOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newAdmin",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "switchAdmin",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newUniV2Pool",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "switchUniV2Pool",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "uniV3Pool",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "int256",
|
||||
"name": "amount0Delta",
|
||||
"type": "int256"
|
||||
},
|
||||
{
|
||||
"internalType": "int256",
|
||||
"name": "amount1Delta",
|
||||
"type": "int256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "_data",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"name": "uniswapV3SwapCallback",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "weth",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,18 +1,36 @@
|
||||
{
|
||||
"contractName": "MemeBurner",
|
||||
"contractAddress": "0x35640264BA900f4AF2b9e3743EA0578eCcF181bE",
|
||||
"Meme1": {
|
||||
"address": "0x4435ABC578136e2Eca50b5EFf950F17CAF42485b",
|
||||
"uniV2Pool": "0xdD84B97DbA213e1aAdFEFD3de7067fC4Ab357378"
|
||||
},
|
||||
"Meme2": {
|
||||
"address": "0xa0B7b2a78dF87eDc70736f7ED9D40d86c37B533F",
|
||||
"uniV2Pool": "0xe9428ba55920DAB804153E9c4E8910EF1564a2b9"
|
||||
},
|
||||
"Meme3": {
|
||||
"address": "0xC99B9d1693b71eF503c86B4cC05f141714176E5b",
|
||||
"uniV2Pool": "0x905F0FA7F878eB8bd50782F9a4B739fb50394715"
|
||||
},
|
||||
"Meme4": {
|
||||
"address": "0xBCf48173f0767465Ef22fcDe2e1a099C8A5B4712",
|
||||
"uniV2Pool": "0x32Ba68Da1d5Df661181C8CA420b96925bFc748AA"
|
||||
},
|
||||
"Meme5": {
|
||||
"address": "0xD563C6d061c5fc09eCf94c6Ce30CB400Ce2FD295",
|
||||
"uniV2Pool": "0xf51E0b3804945d05eC20a4a1a2B0F7eD5BFf0068"
|
||||
},
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "sacrificableList",
|
||||
"type": "address[]"
|
||||
"internalType": "string",
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "uniV2pools",
|
||||
"type": "address[]"
|
||||
"internalType": "string",
|
||||
"name": "symbol",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
@@ -21,152 +39,90 @@
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_developer",
|
||||
"name": "_uniV2Factory",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_rewardLocker",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_memeToken",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "roundGoals",
|
||||
"type": "uint256[]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_liquidityAmountLimit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"stateMutability": "payable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "ArraysHaveDifferentLength",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Impossible",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LiquidityOwnerAlreadyInitialized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NothingToSacrifice",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TokenIsNotInSacrificableList",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToTransfer",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "TokenTransferFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "uniV2Pool",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "UniV2PoolWithoutLiquidity",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "MemeAddedToSacrificeList",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "MemeRemovedFromSacrificeList",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sacrificer",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sacrificedToken",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "sacrificedAmount",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "MemeSacrificed",
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DOMAIN_SEPARATOR",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "uniV2Pool",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addMemeToList",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "currentRound",
|
||||
"name": "allowance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
@@ -181,58 +137,35 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToSacrifice",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountToSacrifice",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "getRewardFor",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "roundNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getSacrificedMeme",
|
||||
"name": "approve",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "participation",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountAchieved",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "liquidityAmountLimit",
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "balanceOf",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
@@ -243,78 +176,27 @@
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "liquidityOwner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "memeList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "memesUniV2Pools",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "meme",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "removeMemeFromList",
|
||||
"name": "burn",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "rewardLocker",
|
||||
"name": "decimals",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"internalType": "uint8",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
@@ -324,61 +206,172 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "rounds",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "goal",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "memeToSacrifice",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountToSacrifice",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "sacrificeMeme",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "reward",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_liquidityOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setLiquidityOwner",
|
||||
"name": "mint",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "weth",
|
||||
"name": "name",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "nonces",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "deadline",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "v",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "r",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "s",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "permit",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transfer",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "uniV2Pool",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
@@ -388,10 +381,6 @@
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"stateMutability": "payable",
|
||||
"type": "receive"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,444 +0,0 @@
|
||||
{
|
||||
"contractName": "Multicall3",
|
||||
"contractAddress": "0xcA11bde05977b3631167028862bE2a173976CA11",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "aggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes[]",
|
||||
"name": "returnData",
|
||||
"type": "bytes[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "allowFailure",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call3[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "aggregate3",
|
||||
"outputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "allowFailure",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call3Value[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "aggregate3Value",
|
||||
"outputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "blockAndAggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getBasefee",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "basefee",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "getBlockHash",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getBlockNumber",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getChainId",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "chainid",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockCoinbase",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "coinbase",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockDifficulty",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "difficulty",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockGasLimit",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "gaslimit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockTimestamp",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "timestamp",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "addr",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getEthBalance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "balance",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getLastBlockHash",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "requireSuccess",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "tryAggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "requireSuccess",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "tryBlockAndAggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
{
|
||||
"contractName": "Quoter",
|
||||
"contractAddress": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_factory",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_WETH9",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "WETH9",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "factory",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "path",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountIn",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "quoteExactInput",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountOut",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "tokenIn",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "tokenOut",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint24",
|
||||
"name": "fee",
|
||||
"type": "uint24"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountIn",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint160",
|
||||
"name": "sqrtPriceLimitX96",
|
||||
"type": "uint160"
|
||||
}
|
||||
],
|
||||
"name": "quoteExactInputSingle",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountOut",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "path",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountOut",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "quoteExactOutput",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountIn",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "tokenIn",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "tokenOut",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint24",
|
||||
"name": "fee",
|
||||
"type": "uint24"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountOut",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint160",
|
||||
"name": "sqrtPriceLimitX96",
|
||||
"type": "uint160"
|
||||
}
|
||||
],
|
||||
"name": "quoteExactOutputSingle",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amountIn",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "int256",
|
||||
"name": "amount0Delta",
|
||||
"type": "int256"
|
||||
},
|
||||
{
|
||||
"internalType": "int256",
|
||||
"name": "amount1Delta",
|
||||
"type": "int256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "path",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"name": "uniswapV3SwapCallback",
|
||||
"outputs": [],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"contractName": "RewardLocker",
|
||||
"contractAddress": "0x061ff0C800aBc1F3C42f696BeB73C70c6929863a",
|
||||
"contractAddress": "0x2952253374973DE0ffbFe35269Ca13FaF28B935F",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -15,17 +15,22 @@
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MemeAltarAlreadyInitialized",
|
||||
"name": "AlreadyInitialized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MemeTokenAlreadyInitialized",
|
||||
"name": "CycleIsNotCompletedYet",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "RoundIsNotCompletedYet",
|
||||
"name": "NotMemeAltar",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "StakePartMoreThan100Percent",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
@@ -57,6 +62,44 @@
|
||||
"name": "ClaimedReward",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "index",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "winnerToken",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "totalCycleRewards",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "CycleCompleted",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "index",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "CycleStarted",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
@@ -69,7 +112,7 @@
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "stakedRound",
|
||||
"name": "stakedCycle",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
@@ -94,7 +137,7 @@
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "unstakeRound",
|
||||
"name": "unstakeCycle",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
@@ -119,7 +162,7 @@
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "roundNumber",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
@@ -138,44 +181,6 @@
|
||||
"name": "Rewarded",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "index",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "winnerToken",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "totalRoundRewards",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "RoundCompleted",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "index",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "RoundStarted",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
@@ -188,7 +193,7 @@
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "unstakeRound",
|
||||
"name": "unstakeCycle",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
@@ -201,11 +206,24 @@
|
||||
"name": "UnstakeOrdered",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "bloodline",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract Bloodline",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "_rounds",
|
||||
"name": "_cycles",
|
||||
"type": "uint256[]"
|
||||
},
|
||||
{
|
||||
@@ -229,7 +247,7 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "_rounds",
|
||||
"name": "_cycles",
|
||||
"type": "uint256[]"
|
||||
}
|
||||
],
|
||||
@@ -248,7 +266,7 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "_rounds",
|
||||
"name": "_cycles",
|
||||
"type": "uint256[]"
|
||||
},
|
||||
{
|
||||
@@ -272,7 +290,70 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "roundNumber",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "cycles",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint32",
|
||||
"name": "cycleCompletedTimestamp",
|
||||
"type": "uint32"
|
||||
},
|
||||
{
|
||||
"internalType": "uint224",
|
||||
"name": "totalSacrificeCompetitionRewards",
|
||||
"type": "uint224"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalStakeRewards",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "sacrificedToken",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getRewards",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "stakeReward",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "sacrificeReward",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
@@ -291,7 +372,7 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "roundNumber",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
@@ -314,26 +395,26 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "roundNumber",
|
||||
"type": "uint256"
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "sacrificedToken",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getSacrificedTokenTotalRewards",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalDefaultRewardsForToken",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalRewardsForToken",
|
||||
"name": "reward",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "getStakeRewardForSacrificeReward",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "stakeReward",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
@@ -349,7 +430,7 @@
|
||||
},
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "roundNumbers",
|
||||
"name": "cycleNumbers",
|
||||
"type": "uint256[]"
|
||||
}
|
||||
],
|
||||
@@ -357,7 +438,36 @@
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalRewardsAmount",
|
||||
"name": "totalSacrificeRewards",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalStakeRewards",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "cycleNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "sacrificedToken",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getTotalSacrificeRewardsForToken",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalSacrificeRewardsForToken",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
@@ -373,7 +483,7 @@
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_memeToken",
|
||||
"name": "_bloodline",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
@@ -384,7 +494,7 @@
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "lastCompletedRound",
|
||||
"name": "lastCompletedCycle",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
@@ -408,26 +518,13 @@
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "memeToken",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract MemeToken",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "orderUnstake",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "unstakeRound",
|
||||
"name": "unstakeCycle",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
@@ -438,7 +535,31 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "roundIndex",
|
||||
"name": "cycleIndex",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "winnerToken",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "registerCycleCompleted",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "cycleIndex",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
@@ -447,7 +568,7 @@
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"name": "registerNextRound",
|
||||
"name": "registerNextCycle",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
@@ -487,88 +608,6 @@
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "roundIndex",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "winnerToken",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "registerRoundCompleted",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "rewards",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "rounds",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "roundCompleted",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalDefaultRewards",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "totalRewards",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
@@ -578,7 +617,7 @@
|
||||
},
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "_rounds",
|
||||
"name": "_cycles",
|
||||
"type": "uint256[]"
|
||||
},
|
||||
{
|
||||
@@ -646,7 +685,7 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "_rounds",
|
||||
"name": "_cycles",
|
||||
"type": "uint256[]"
|
||||
},
|
||||
{
|
||||
@@ -708,7 +747,7 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "unstakeRound",
|
||||
"name": "unstakeCycle",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
[{"inputs":[{"internalType":"address","name":"meme","type":"address"},{"internalType":"address","name":"uniV2Pool","type":"address"}],"name":"addMemeToList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint40","name":"b1","type":"uint40"},{"internalType":"uint40","name":"m1","type":"uint40"},{"internalType":"uint40","name":"b2","type":"uint40"},{"internalType":"uint40","name":"m2","type":"uint40"},{"internalType":"uint40","name":"b3","type":"uint40"},{"internalType":"uint40","name":"m4","type":"uint40"}],"internalType":"struct MemeAltar.BM","name":"newBM","type":"tuple"}],"name":"adjustBM","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint112","name":"newDefaultGoal","type":"uint112"}],"name":"adjustDefaultGoal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"newDurationLimit","type":"uint32"}],"name":"adjustRoundDurationLimit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"switchAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"meme","type":"address"},{"internalType":"address","name":"newUniV2Pool","type":"address"}],"name":"switchUniV2Pool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"meme","type":"address"}],"name":"removeMemeFromList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
|
||||
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 62 KiB |
@@ -0,0 +1 @@
|
||||
!function(){function e(e){for(var o=0;o<c.length;o++)c[o]=0;for(var o=0;o<e.length;o++)c[o%4]=(c[o%4]<<5)-c[o%4]+e.charCodeAt(o)}function o(){var e=c[0]^c[0]<<11;return c[0]=c[1],c[1]=c[2],c[2]=c[3],c[3]=c[3]^c[3]>>19^e^e>>8,(c[3]>>>0)/(1<<31>>>0)}function r(){var e=Math.floor(360*o()),r=60*o()+40+"%",t=25*(o()+o()+o()+o())+"%",l="hsl("+e+","+r+","+t+")";return l}function t(e){for(var r=e,t=e,l=Math.ceil(r/2),n=r-l,a=[],c=0;t>c;c++){for(var i=[],f=0;l>f;f++)i[f]=Math.floor(2.3*o());var s=i.slice(0,n);s.reverse(),i=i.concat(s);for(var h=0;h<i.length;h++)a.push(i[h])}return a}function l(o){var t={};return t.seed=o.seed||Math.floor(Math.random()*Math.pow(10,16)).toString(16),e(t.seed),t.size=o.size||8,t.scale=o.scale||4,t.color=o.color||r(),t.bgcolor=o.bgcolor||r(),t.spotcolor=o.spotcolor||r(),t}function n(e,o){var r=t(e.size),l=Math.sqrt(r.length);o.width=o.height=e.size*e.scale;var n=o.getContext("2d");n.fillStyle=e.bgcolor,n.fillRect(0,0,o.width,o.height),n.fillStyle=e.color;for(var a=0;a<r.length;a++)if(r[a]){var c=Math.floor(a/l),i=a%l;n.fillStyle=1==r[a]?e.color:e.spotcolor,n.fillRect(i*e.scale,c*e.scale,e.scale,e.scale)}return o}function a(e){var e=l(e||{}),o=document.createElement("canvas");return n(e,o),o}var c=new Array(4),i={create:a,render:n};"undefined"!=typeof module&&(module.exports=i),"undefined"!=typeof window&&(window.blockies=i)}();
|
||||
@@ -1,53 +1,34 @@
|
||||
.bloodline-devider
|
||||
font-size: 42px
|
||||
text-align: center
|
||||
margin: 16px 0
|
||||
@media (min-width: 992px)
|
||||
margin: 24px 0
|
||||
|
||||
.bloodline-border
|
||||
padding: 16px
|
||||
padding: 12px
|
||||
border-radius: 16px
|
||||
border: 2px solid #000
|
||||
&.bloodline-border--variant1
|
||||
border: 4px solid var(--midnight-black)
|
||||
@media (min-width: 992px)
|
||||
border: 4px solid #000
|
||||
border: 3px solid var(--midnight-black)
|
||||
&.bloodline-border__thin
|
||||
border-width: 1px
|
||||
@media (min-width: 992px)
|
||||
padding: 24px 32px
|
||||
border: 4px solid #000
|
||||
padding: 18px 24px
|
||||
border: 3px solid #000
|
||||
&.purple
|
||||
border-color: var(--purple)
|
||||
&.white
|
||||
border-color: var(--white)
|
||||
&.grey
|
||||
border-color: var(--grey, #858585)
|
||||
|
||||
.bloodline-badge
|
||||
padding: 8px 16px 8px 16px
|
||||
padding: 6px 12px 6px 12px
|
||||
border-radius: 14px
|
||||
background-color: #0F0F0F
|
||||
display: flex
|
||||
.bloodline-badge-icon
|
||||
margin-right: 8px
|
||||
|
||||
.card
|
||||
display: block
|
||||
overflow: hidden
|
||||
overflow-wrap: break-word
|
||||
position: relative
|
||||
padding: 0
|
||||
text-decoration: none
|
||||
transition-duration: .28s
|
||||
transition-property: box-shadow,opacity,background
|
||||
transition-timing-function: cubic-bezier(.4,0,.2,1)
|
||||
z-index: 0
|
||||
border-color: rgba(var(--v-border-color),var(--v-border-opacity))
|
||||
border-style: solid
|
||||
border-width: 0
|
||||
border-radius: 16px
|
||||
box-shadow: 0 2px 1px -1px rgba(0, 0, 0, .2),0 1px 1px 0rgba(0, 0, 0, .14),0 1px 3px 0 rgba(0, 0, 0, .12)
|
||||
background-color: $darkgrey
|
||||
@media (min-width: 992px)
|
||||
border-radius: 4px
|
||||
&.card--variant1
|
||||
border-radius: 0
|
||||
&.grey
|
||||
background-color: var(--grey)
|
||||
|
||||
.bloodline-token
|
||||
height: 50px
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
|
||||
.btn
|
||||
padding: 16px 24px
|
||||
gap: 8px
|
||||
border-radius: 14px
|
||||
border: none
|
||||
display: block
|
||||
width: 100%
|
||||
text-decoration: none
|
||||
&:hover,&:focus,&:active
|
||||
cursor: pointer
|
||||
&[disabled], &.btn--disabled
|
||||
background-color: darken($purple, 10%)
|
||||
cursor: not-allowed
|
||||
&.black
|
||||
background-color: var(--midnight-black)
|
||||
&.btn-immortal
|
||||
|
||||
background-color: $purple
|
||||
color: $button-color
|
||||
font-size: 24px
|
||||
padding: 16px 24px
|
||||
gap: 8px
|
||||
border-radius: 14px
|
||||
@media (min-width: 992px)
|
||||
background-color: $red
|
||||
&[disabled], &.btn--disabled
|
||||
background-color: darken($purple, 10%)
|
||||
cursor: not-allowed
|
||||
&:hover,&:focus,&:active
|
||||
background-color: lighten($button-background-color, 10%),
|
||||
color: darken($button-color, 10%),
|
||||
cursor: pointer
|
||||
background-color: darken($purple, 10%),
|
||||
|
||||
@@ -17,15 +17,15 @@ body
|
||||
background-color: #2D2D2D
|
||||
color: $white
|
||||
font-family: 'Inter', sans-serif
|
||||
&.sideoutpanel-open
|
||||
&:not(.mobile)
|
||||
overflow-y: hidden
|
||||
padding-right: 10px
|
||||
.navbar
|
||||
padding-right: 10px
|
||||
|
||||
.main
|
||||
padding-top: 120px
|
||||
@media (min-width: 992px)
|
||||
padding-top: 208px
|
||||
html
|
||||
font-size: var(--font-size-main)
|
||||
html, body, #app
|
||||
height: 100%
|
||||
|
||||
body
|
||||
margin: 0
|
||||
@@ -33,16 +33,21 @@ body
|
||||
#app
|
||||
display: flex
|
||||
flex-direction: column
|
||||
height: 100vh
|
||||
.footer
|
||||
margin-top: auto
|
||||
|
||||
.container
|
||||
margin-right: auto
|
||||
margin-left: auto
|
||||
padding-right: 16px
|
||||
padding-left: 16px
|
||||
// &.container--variant1
|
||||
// @media (min-width: 992px)
|
||||
// max-width: 800px
|
||||
// padding: 24px 64px
|
||||
@media (min-width: 992px)
|
||||
max-width: 800px
|
||||
padding-right: 15px
|
||||
padding-left: 15px
|
||||
max-width: 670px
|
||||
|
||||
h1
|
||||
font-weight: 700
|
||||
|
||||
@@ -10,12 +10,14 @@ $tertiary-light: lighten($tertiary, 20%)
|
||||
|
||||
$white: #F9F9FA
|
||||
$black: #0F0F0F
|
||||
$grey: #808080
|
||||
$grey: #858585
|
||||
$grey-light: lighten($grey, 20%)
|
||||
$red: #8B0000
|
||||
$purple: #4B0082
|
||||
$midnight-black: #0F0F0F
|
||||
$darkgrey: #202020
|
||||
$grey2: #2D2D2D
|
||||
$dark-grey: #202020
|
||||
|
||||
$button-color: $white
|
||||
$button-background-color: $black
|
||||
@@ -29,15 +31,91 @@ $button-background-color: $black
|
||||
--tertiary: #{$tertiary}
|
||||
--tertiary-light: #{$tertiary-light}
|
||||
--tertiary-dark: #{$tertiary-dark}
|
||||
--white: #{#F9F9FA}
|
||||
--grey: #{$grey}
|
||||
--grey-light: #{$grey-light}
|
||||
--grey2: #{$grey2}
|
||||
--dark-grey: #{$dark-grey}
|
||||
--purple: #{$purple}
|
||||
--blood-color: #{$red}
|
||||
--midnight-black: #{$midnight-black}
|
||||
--black: #{$midnight-black}
|
||||
--darkgrey: #{$darkgrey}
|
||||
|
||||
//fonts
|
||||
.tiny-text
|
||||
font-family: Inter
|
||||
font-size: 14px
|
||||
.low-mid-text
|
||||
font-family: Inter
|
||||
font-size: 16px
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
line-height: normal
|
||||
// @media (min-width: 992px)
|
||||
// font-size: 18px
|
||||
.mid-mid-text
|
||||
font-family: Inter
|
||||
font-size: 18px
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
line-height: normal
|
||||
// @media (min-width: 992px)
|
||||
// font-size: 24px
|
||||
.mid-text
|
||||
font-family: Inter
|
||||
font-size: 18px
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
line-height: normal
|
||||
.small-text
|
||||
font-family: Inter
|
||||
font-size: 14px
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
line-height: normal
|
||||
@media (min-width: 992px)
|
||||
font-size: 18px
|
||||
.number-mobile
|
||||
font-family: Inter
|
||||
font-size: 24px
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
line-height: normal
|
||||
letter-spacing: 4.32px
|
||||
.sub-header
|
||||
font-family: Inter
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
line-height: normal
|
||||
font-size: 24px
|
||||
// @media (min-width: 992px)
|
||||
// font-size: 32px
|
||||
.header
|
||||
font-family: Inter
|
||||
font-size: 32px
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
line-height: normal
|
||||
// @media (min-width: 992px)
|
||||
// font-size: 30px
|
||||
|
||||
// :root
|
||||
// --font-size-text: 16px
|
||||
// --font-size-title: 32px
|
||||
// @media (min-width: 992px)
|
||||
// --font-size-text: 24px
|
||||
// --font-size-title: 36px
|
||||
|
||||
.text-center
|
||||
text-align: center
|
||||
|
||||
.transparent
|
||||
background-color: transparent
|
||||
|
||||
.card
|
||||
border-radius: 16px
|
||||
@media (min-width: 992px)
|
||||
padding: 48px 32px
|
||||
&.card--glow
|
||||
box-shadow: 0px 12px 150px 0px rgba(75, 0, 130, 0.35)
|
||||
|
||||
@@ -1,15 +1,36 @@
|
||||
<template>
|
||||
<div class="blood-chart-wrapper" v-if="props.data">
|
||||
<div class="blood-chart-element" v-for="coin in props.data.token" :key="coin.name">
|
||||
<div class="blood-chart-element-header">
|
||||
<div class="blood-chart-coin">
|
||||
<img :src="getImageUrl(coin.vamplogo)" alt="logo" />
|
||||
<div class="blood-chart-wrapper">
|
||||
<div class="blood-arrow left">
|
||||
<img
|
||||
class="swiper-arrow"
|
||||
src="/assets/img/blood-arrow-left.png"
|
||||
alt="left-arrow"
|
||||
@click="swiperInstance.slidePrev()"
|
||||
v-if="token?.length > 3"
|
||||
/>
|
||||
</div>
|
||||
<swiper
|
||||
class="blood-chart"
|
||||
:slidesPerView="3"
|
||||
:centeredSlides="false"
|
||||
:initial-slide="0"
|
||||
:spaceBetween="IsMobile ? 35 : 0"
|
||||
@swiper="onSwiper"
|
||||
>
|
||||
<swiper-slide class="blood-chart-element" v-for="coin in token" :key="coin.name">
|
||||
<div class="blood-chart-element-header">
|
||||
<div class="blood-chart-coin">
|
||||
<template v-if="cycleStore.getCycleWinner.contractAddress === coin.contractAddress">
|
||||
<img :src="coin.vampwinner2" alt="logo" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<img :src="coin.vamplogo" alt="logo" />
|
||||
</template>
|
||||
</div>
|
||||
<div class="blood-chart-coin-title low-mid-text">{{ coin.name }}</div>
|
||||
</div>
|
||||
<div class="blood-chart-coin-title">{{ coin.name }}</div>
|
||||
</div>
|
||||
<div class="blood-chart-element-body">
|
||||
<div class="blood-chart-bar-wrapper">
|
||||
<div class="blood-chart-bar" :style="`height: ${getPercentage(coin.amount, props.data.goal)}%`">
|
||||
<div class="blood-chart-element-body">
|
||||
<div class="blood-chart-bar-wrapper">
|
||||
<svg
|
||||
class="waves"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -31,121 +52,183 @@
|
||||
<use xlink:href="#gentle-wave" x="48" y="7" fill="#8B0000" />
|
||||
</g>
|
||||
</svg>
|
||||
<div class="wrapper">
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div
|
||||
class="blood-chart-bar"
|
||||
:style="`height: ${getPercentageBloodChart(coin.amount, props.data.goal)}%`"
|
||||
>
|
||||
<div class="wrapper">
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
<div><span class="dot"></span></div>
|
||||
</div>
|
||||
<div class="blood-chart-bar-percentage">
|
||||
{{ getPercentage(coin.amount, props.data.goal) }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="blood-chart-bar-percentage">{{ getPercentage(coin.amount, props.data.goal) }}%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="blood-chart-element-footer">
|
||||
<div class="blood-chart-amount">
|
||||
{{ compactNumber(coin.amount) }}
|
||||
<div class="blood-chart-element-footer">
|
||||
<div class="blood-chart-amount">
|
||||
{{ formatNumber(coin.amountInBLD / 10n ** tokenStore.memeToken.decimals) }}
|
||||
</div>
|
||||
<div>$BLOOD</div>
|
||||
</div>
|
||||
<div class="blood-chart-coin">$BLOOD</div>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
|
||||
<!-- <button @click="swiperInstance.slidePrev()">left</button>
|
||||
<button @click="swiperInstance.slideNext()">left</button> -->
|
||||
</swiper>
|
||||
<div class="blood-arrow right">
|
||||
<img
|
||||
class="swiper-arrow"
|
||||
src="/assets/img/blood-arrow-right.png"
|
||||
alt="left-arrow"
|
||||
@click="swiperInstance.slideNext()"
|
||||
v-if="token?.length > 3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getPercentage, compactNumber } from "@/helper/helper.js";
|
||||
import { computed, ref, inject, onMounted } from "vue";
|
||||
import { getPercentage, compactNumber, formatNumber } from "@/helper/helper.js";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
|
||||
import { Swiper, SwiperSlide } from "swiper/vue";
|
||||
|
||||
// Import Swiper styles
|
||||
import "swiper/css";
|
||||
import "swiper/css/navigation";
|
||||
import "swiper/css/pagination";
|
||||
|
||||
const cycleStore = useCycleStore();
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const props = defineProps({
|
||||
data: Array,
|
||||
data: Object,
|
||||
});
|
||||
|
||||
console.log(props.data);
|
||||
onMounted(() => {
|
||||
console.log("bloodchart-data", props.data);
|
||||
});
|
||||
|
||||
function getImageUrl(url) {
|
||||
return new URL(url, import.meta.url).href;
|
||||
const swiperInstance = ref();
|
||||
|
||||
function onSwiper(swiper) {
|
||||
swiperInstance.value = swiper;
|
||||
}
|
||||
|
||||
// const dataPoints = [
|
||||
// {
|
||||
// name: "$PEPE",
|
||||
// percentage: 62.2,
|
||||
// icon: "/src/assets/img/token/pepevamp.png",
|
||||
// },
|
||||
// {
|
||||
// name: "$SHIB",
|
||||
// percentage: 31.2,
|
||||
// icon: "/src/assets/img/token/shibvamp.png",
|
||||
// },
|
||||
// {
|
||||
// name: "$ELON",
|
||||
// percentage: 54.5,
|
||||
// icon: "/src/assets/img/token/elonvamp.png",
|
||||
// },
|
||||
// ];
|
||||
const token = computed(() => props.data?.token);
|
||||
|
||||
//start with visual 5% of the filled bar, because otherwise the percentage number is not visible
|
||||
function getPercentageBloodChart(amount, goal) {
|
||||
let returnNumber = 5;
|
||||
if ((Number(amount) / Number(goal)) * 100 < 5) {
|
||||
returnNumber = 5;
|
||||
} else {
|
||||
returnNumber = (Number(amount) / Number(goal)) * 100;
|
||||
}
|
||||
return returnNumber.toFixed(2);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.blood-chart-wrapper
|
||||
// margin-top: 56px
|
||||
display: flex
|
||||
justify-content: center
|
||||
// margin-bottom: 80px
|
||||
position: relative
|
||||
.blood-chart
|
||||
height: 750px
|
||||
width: 100%
|
||||
justify-content: space-around
|
||||
display: inline-flex
|
||||
@media (min-width: 992px)
|
||||
gap: 96px
|
||||
gap: 32px
|
||||
width: unset
|
||||
justify-content: unset
|
||||
|
||||
.blood-chart-element
|
||||
height: 100%
|
||||
width: 80px
|
||||
align-items: center
|
||||
@media (min-width: 992px)
|
||||
width: 100px
|
||||
|
||||
display: flex
|
||||
flex-direction: column
|
||||
.blood-chart-element-header
|
||||
flex: 0 0 100px
|
||||
.blood-chart-coin
|
||||
height: 80px
|
||||
width: 80px
|
||||
border-radius: 80px
|
||||
margin-left: auto
|
||||
margin-right: auto
|
||||
position: relative
|
||||
margin-bottom: 16px
|
||||
overflow: hidden
|
||||
height: 80px
|
||||
width: 80px
|
||||
@media (min-width: 992px)
|
||||
height: 72px
|
||||
width: 72px
|
||||
img
|
||||
height: 100%
|
||||
width: 100%
|
||||
.blood-chart-coin-title
|
||||
text-align: center
|
||||
margin-bottom: 32px
|
||||
font-size: 16px
|
||||
@media (min-width: 992px)
|
||||
font-size: 24px
|
||||
.blood-chart-element-body
|
||||
background-color: rgba(233, 233, 233, 0.2)
|
||||
flex: 1 1 auto
|
||||
flex: 0 0 500px
|
||||
width: 60px
|
||||
border-radius: 8px 8px 40px 40px
|
||||
text-align: left
|
||||
overflow: hidden
|
||||
.blood-chart-bar-wrapper
|
||||
height: 100%
|
||||
display: flex
|
||||
flex-direction: column
|
||||
.blood-chart-bar
|
||||
.waves
|
||||
margin-top: auto
|
||||
.blood-chart-bar
|
||||
background-color: var(--blood-color)
|
||||
position: relative
|
||||
border-radius: 0 0 40px 40px
|
||||
.blood-chart-bar-percentage
|
||||
font-size: 14px
|
||||
text-align: center
|
||||
margin-top: 16px
|
||||
.waves
|
||||
position: absolute
|
||||
top: -10px
|
||||
width: 100%
|
||||
height: 10px
|
||||
|
||||
.blood-chart-element-footer
|
||||
margin-top: 32px
|
||||
text-align: center
|
||||
.blood-chart-amount
|
||||
font-size: 24px
|
||||
margin-bottom: 8px
|
||||
.blood-chart-coin
|
||||
font-size: 16px
|
||||
|
||||
|
||||
.swiper-slide
|
||||
width: 80px
|
||||
|
||||
|
||||
.blood-arrow
|
||||
min-width: 30px
|
||||
&.left, &.right
|
||||
img
|
||||
height: 50px
|
||||
position: absolute
|
||||
top: 50%
|
||||
z-index: 0
|
||||
&.right
|
||||
img
|
||||
right: -5px
|
||||
&.left
|
||||
img
|
||||
left: -5px
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div
|
||||
class="connected-stake bloodline-border card"
|
||||
:class="{ 'card--dense': dense }"
|
||||
@click="
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
"
|
||||
>
|
||||
<div class="connected-stake-headline mid-mid-text" v-if="slots.headline">
|
||||
<slot name="headline"></slot>
|
||||
</div>
|
||||
<div class="connected-stake-subheadline" v-if="slots.subheadline">
|
||||
<slot name="subheadline"></slot>
|
||||
</div>
|
||||
<div class="connected-stake-body" v-if="slots.body">
|
||||
<slot name="body"></slot>
|
||||
</div>
|
||||
<slot name="actions"></slot>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
|
||||
import { ref } from "vue";
|
||||
import { useSlots } from "vue";
|
||||
const slots = useSlots();
|
||||
|
||||
const props = defineProps({
|
||||
stakeonly: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.card--dense
|
||||
padding: 8px
|
||||
.connected-stake
|
||||
background-color: var(--darkgrey)
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 16px
|
||||
border: 2px solid var(--grey, #858585)
|
||||
border-color: var(--grey, #858585)
|
||||
@media (min-width: 992px)
|
||||
padding: 8px 12px
|
||||
&.connected-stake--variant1
|
||||
background-color: transparent
|
||||
border: none
|
||||
padding: 16px 6px
|
||||
.connected-stake-headline
|
||||
text-align: center
|
||||
.connected-stake-subheadline
|
||||
text-align: center
|
||||
.connected-stake-body
|
||||
display: flex
|
||||
text-align: left
|
||||
gap: 16px
|
||||
height: 56px
|
||||
.token-logo
|
||||
margin-left: auto
|
||||
.connected-stake-buttons
|
||||
display: flex
|
||||
text-align: center
|
||||
gap: 16px
|
||||
justify-content: center
|
||||
// div
|
||||
// flex: 1 1 50%
|
||||
</style>
|
||||
@@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<card-component>
|
||||
<template v-slot:headline> Unclaimed </template>
|
||||
<template v-slot:body>
|
||||
<token-name-price
|
||||
:name="tokenStore.getToken(walletStore.memeToken?.contractAddress)?.name"
|
||||
:price="formatNumber(walletStore.unclaimedRewards)"
|
||||
></token-name-price>
|
||||
<token-logo img="/assets/img/token/bloodline.png" :alt="'bloodline logo'"></token-logo>
|
||||
</template>
|
||||
<template v-slot:actions>
|
||||
<template v-if="walletStore.unclaimedRewards > 0">
|
||||
<Transition name="smooth">
|
||||
<div class="connected-stake-buttons" v-show="!stakeMenu">
|
||||
<div class="btn btn-immortal mid-mid-text" @click="claimAll" v-if="stateStake === 0">Claim</div>
|
||||
<div class="btn btn-immortal mid-mid-text" disabled v-else-if="stateStake === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-else-if="stateStake === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div class="btn btn-immortal mid-mid-text" @click="openStake">Stake</div>
|
||||
</div>
|
||||
</Transition>
|
||||
<Transition name="smooth">
|
||||
<stake-menu
|
||||
v-model="tokenNumber"
|
||||
@close="stakeMenu = false"
|
||||
:amount="walletStore.unclaimedRewards"
|
||||
:stake="stake"
|
||||
v-if="stakeMenu"
|
||||
>
|
||||
<template v-slot:body>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateClaimComp === 0">
|
||||
Enter Amount
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal stake-button"
|
||||
v-else-if="stateClaimComp === 1"
|
||||
@click="stakeAndClaimAllCycles"
|
||||
>
|
||||
Stake & Claim Rest
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateClaimComp === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateClaimComp === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div
|
||||
class="btn transparent small-text cancel-button text-center"
|
||||
@click="stakeMenu = false"
|
||||
>
|
||||
Cancel
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:message-end>
|
||||
<div class="input-balance">
|
||||
Balance:
|
||||
{{ formatNumber(walletStore.unclaimedRewards) }}
|
||||
</div>
|
||||
</template>
|
||||
</stake-menu>
|
||||
</Transition>
|
||||
<div class="connected-stake-first-round small-text text-center">
|
||||
You can claim, once the cycle is over.
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="btn btn-immortal mid-mid-text text-center" @click="router.push({ name: 'home' })">
|
||||
Go to Sacrifice
|
||||
</div>
|
||||
<div class="small-text text-center">Sacrifice to earn $BLOOD</div>
|
||||
</template>
|
||||
</template>
|
||||
</card-component>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from "vue";
|
||||
import CardComponent from "@/components/CardComponent.vue";
|
||||
import StakeMenu from "@/components/StakeMenu.vue";
|
||||
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||
import TokenLogo from "@/components/TokenLogo.vue";
|
||||
import { waitForTransaction } from "@wagmi/core";
|
||||
import LoadingComponent from "@/components/LoadingComponent.vue";
|
||||
import StakeSuccessToast from "@/components/toasts/StakeSuccessToast.vue";
|
||||
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useToast } from "vue-toastification";
|
||||
import { formatNumber } from "@/helper/helper.js";
|
||||
import { showSuccessToast } from "@/helper/toast.js";
|
||||
|
||||
const toast = useToast();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
const router = useRouter();
|
||||
|
||||
const props = defineProps({
|
||||
stakeonly: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const stakeMenu = ref(false);
|
||||
const stake = ref(null);
|
||||
const tokenNumber = ref(null);
|
||||
/**
|
||||
* state 0 enter amount
|
||||
* state 1 rdy to go
|
||||
* state 2 signing
|
||||
* state 3 loading
|
||||
* state 4 staked
|
||||
*/
|
||||
const state = ref(0);
|
||||
const stateClaim = ref(0);
|
||||
|
||||
function openStake() {
|
||||
stake.value = true;
|
||||
stakeMenu.value = true;
|
||||
}
|
||||
|
||||
async function stakeAndClaimAllCycles() {
|
||||
try {
|
||||
const unclaimedRewards = walletStore.memeToken?.unclaimedRewards / 10n ** tokenStore.memeToken.decimals;
|
||||
stateClaim.value = 2;
|
||||
console.log("unclaimedRewards", unclaimedRewards);
|
||||
const coefficient = BigInt(10000 * tokenNumber.value) / unclaimedRewards;
|
||||
var hash = await rewardLockerStore.stakeAndClaimAllCycles(coefficient);
|
||||
stateClaim.value = 3;
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
stateClaim.value = 4;
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
//ClaimedReward (address staker, uint256 reward)
|
||||
const outputClaim = BigInt(rewardData.topics[2]) / 10n ** tokenStore.memeToken.decimals;
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim),
|
||||
"Success!",
|
||||
"You just claimed and staked",
|
||||
"Join the next cycle to increase your rewards and win with your clan"
|
||||
);
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
stateClaim.value = 0;
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
|
||||
async function claimAll() {
|
||||
try {
|
||||
state.value = 2;
|
||||
const hash = await rewardLockerStore.claimAll();
|
||||
state.value = 3;
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
//ClaimedReward (address staker, uint256 reward)
|
||||
const outputClaim = rewardData.topics[2] / 10n ** tokenStore.memeToken.decimals;
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim),
|
||||
"Success!",
|
||||
"You just claimed",
|
||||
"Join the next cycle to increase your rewards and win with your clan."
|
||||
);
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
state.value = 0;
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
|
||||
const stateStake = computed(() => {
|
||||
let returnState = 0;
|
||||
if (state.value === 2) {
|
||||
returnState = 2;
|
||||
} else if (state.value === 3) {
|
||||
returnState = 3;
|
||||
}
|
||||
return returnState;
|
||||
});
|
||||
|
||||
const stateClaimComp = computed(() => {
|
||||
let returnState = 0;
|
||||
console.log("tokenNumber.value", tokenNumber.value);
|
||||
if (
|
||||
tokenNumber.value === null ||
|
||||
tokenNumber.value === "" ||
|
||||
tokenNumber.value === 0 ||
|
||||
tokenNumber.value > walletStore.memeToken?.unclaimedRewards
|
||||
) {
|
||||
returnState = 0;
|
||||
} else if (stateClaim.value === 2) {
|
||||
returnState = 2;
|
||||
} else if (stateClaim.value === 3) {
|
||||
returnState = 3;
|
||||
} else if (tokenNumber.value !== null || tokenNumber.value !== "" || tokenNumber.value > 0) {
|
||||
returnState = 1;
|
||||
}
|
||||
return returnState;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass"></style>
|
||||
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<div class="connect-wallet-wrapper">
|
||||
<template v-if="!walletStore.connected">
|
||||
<div class="connect-wallet-headline low-mid-text">Connect your wallet</div>
|
||||
<div class="connectors-wrapper">
|
||||
<div
|
||||
class="connectors-element card"
|
||||
:class="[[connector.id]]"
|
||||
v-for="connector in walletStore.config?.connectors"
|
||||
@click="connectWallet(connector)"
|
||||
>
|
||||
<div class="connector-icon">
|
||||
<template v-if="connector.id === 'injected'">
|
||||
<font-awesome-icon :icon="['fas', 'wallet']" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<img :src="`/assets/img/connectors/${connector.id}.svg`" :alt="`${connector.name} Logo`" />
|
||||
</template>
|
||||
</div>
|
||||
<div class="connector-name">
|
||||
<template
|
||||
v-if="
|
||||
connector.id !== 'metaMask' ||
|
||||
(connector.id === 'metaMask' && isMetaMaskInstalled(connector))
|
||||
"
|
||||
>
|
||||
{{ connector.name }}
|
||||
</template>
|
||||
<template v-else> Install {{ connector.name }} </template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>Are you coming from Binance, Bybit, Kucoin or any other crypto exchange?</div>
|
||||
<div>Follow these instructions first.</div>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div class="connected-header">
|
||||
<div class="connected-header-avatar">
|
||||
<img :src="getblocky(walletStore.address)" alt="avatar" />
|
||||
</div>
|
||||
<div class="connected-header-address">
|
||||
{{ getAddressShortName(walletStore.address) }}
|
||||
</div>
|
||||
<div class="connected-header-logout" @click="disconnectWallet">
|
||||
<font-awesome-icon :icon="['fas', 'fa-arrow-right-from-bracket']" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="connected-tokens-headline">Your Tokens</div>
|
||||
<div class="connected-tokens">
|
||||
<div class="connected-token" v-for="token in walletStore.token">
|
||||
<token-name-price
|
||||
:name="tokenStore.getToken(token.contractAddress).name"
|
||||
:price="token.balanceOf / 10n ** tokenStore.getToken(token.contractAddress).decimals"
|
||||
></token-name-price>
|
||||
<div class="connected-token-button">
|
||||
<div class="bloodline-badge grey" @click="badgeClick(token)">
|
||||
<div
|
||||
class="bloodline-badge-text"
|
||||
v-if="tokenStore.memeToken.contractAddress === token.contractAddress"
|
||||
>
|
||||
Buy
|
||||
</div>
|
||||
<div v-else class="bloodline-badge-text">Sacrifice</div>
|
||||
</div>
|
||||
</div>
|
||||
<token-logo :img="tokenStore.getToken(token.contractAddress).logo" :alt="'test'"></token-logo>
|
||||
</div>
|
||||
</div>
|
||||
<stake-component-v1 :variant="3"></stake-component-v1>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, toRaw, onMounted, onUnmounted, getCurrentInstance } from "vue";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import TokenNamePrice from "./TokenNamePrice.vue";
|
||||
import TokenLogo from "./TokenLogo.vue";
|
||||
import StakeComponentV1 from "@/components/StakeComponentV1.vue";
|
||||
|
||||
import { getAddressShortName, getblocky } from "@/helper/helper.js";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { disconnect } from "@wagmi/core";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
// const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
|
||||
async function disconnectWallet() {
|
||||
console.log("disconnectWallet");
|
||||
try {
|
||||
instance.parent.emit("update:modelValue", false);
|
||||
await disconnect();
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
}
|
||||
}
|
||||
|
||||
function isMetaMaskInstalled(connector) {
|
||||
const metamaskInstalled = connector?.options?.getProvider();
|
||||
if (metamaskInstalled) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//go to the sacrifice-page and select the clicked token
|
||||
//if contract === bloodline show buy
|
||||
//we could also show buy, if there is no pepe
|
||||
function badgeClick(token) {
|
||||
var tokenData = tokenStore.getToken(token.contractAddress);
|
||||
if (tokenStore.memeToken.contractAddress === token.contractAddress) {
|
||||
//buy
|
||||
window.open(
|
||||
`https://app.uniswap.org/swap?inputCurrency=ETH&outputCurrency=${token.contractAddress}&chain=goerli`,
|
||||
"_blank"
|
||||
);
|
||||
} else {
|
||||
router.push({ name: "home" });
|
||||
instance.parent.emit("update:modelValue", false);
|
||||
}
|
||||
}
|
||||
|
||||
//special case for metaMask, but I think that is the most used wallet
|
||||
async function connectWallet(connector) {
|
||||
if (connector.id === "metaMask" && !isMetaMaskInstalled(connector)) {
|
||||
window.open(" https://metamask.io/", "_blank");
|
||||
return;
|
||||
}
|
||||
instance.parent.emit("update:modelValue", false);
|
||||
await walletStore.connectWallet(toRaw(connector));
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.connect-wallet-wrapper
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 24px
|
||||
.connectors-wrapper
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
.connectors-element
|
||||
display: flex
|
||||
padding: 12px
|
||||
border: 1px solid rgba(152, 161, 192, 0.24)
|
||||
background: var(--grey, #858585)
|
||||
color: var(--midnight-black, #0F0F0F)
|
||||
&:hover, &:active, &:focus
|
||||
background-color: lighten(#858585, 20%)
|
||||
cursor: pointer
|
||||
&.injected
|
||||
.connector-icon
|
||||
background-color: white
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-items: center
|
||||
svg
|
||||
font-size: 25px
|
||||
.connector-icon
|
||||
border-radius: 12px
|
||||
width: 40px
|
||||
overflow: hidden
|
||||
height: 40px
|
||||
.connector-name
|
||||
padding: 0 8px
|
||||
align-self: center
|
||||
font-size: 16px
|
||||
@media (min-width: 992px)
|
||||
font-size: 18px
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.connected-header
|
||||
margin-bottom: 24px
|
||||
display: flex
|
||||
gap: 16px
|
||||
align-items: center
|
||||
.connected-header-avatar
|
||||
img
|
||||
border-radius: 8px
|
||||
.connected-header-logout
|
||||
margin-left: auto
|
||||
&:hover, &:active, &:focus
|
||||
cursor: pointer
|
||||
svg
|
||||
font-size: 25px
|
||||
|
||||
.connected-tokens-headline
|
||||
font-size: 18px
|
||||
margin-bottom: 16px
|
||||
.connected-tokens
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 16px
|
||||
margin-bottom: 24px
|
||||
.connected-token
|
||||
display: flex
|
||||
gap: 16px
|
||||
align-items: center
|
||||
height: 56px
|
||||
.connected-token-button
|
||||
margin-left: auto
|
||||
.bloodline-badge
|
||||
padding: 4px 16px
|
||||
color: black
|
||||
font-size: 14px
|
||||
&:hover, &:active, &:focus
|
||||
cursor: pointer
|
||||
background-color: var(--grey-light)
|
||||
</style>
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<div class="loading-container">
|
||||
<div class="blood"></div>
|
||||
<div class="blood"></div>
|
||||
<div class="blood"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="sass">
|
||||
.loading-container
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: center
|
||||
gap: 10px
|
||||
|
||||
.blood
|
||||
width: 15px
|
||||
height: 15px
|
||||
border: 1px solid black
|
||||
border-radius: 0% 100% 100% 100%
|
||||
transform: rotate(45deg)
|
||||
animation: blink 1s infinite
|
||||
@media (min-width: 992px)
|
||||
width: 20px
|
||||
height: 20px
|
||||
|
||||
.blood
|
||||
&:nth-child(1)
|
||||
animation-delay: -.2s
|
||||
|
||||
&:nth-child(2)
|
||||
animation-delay: 0.2s
|
||||
|
||||
&:nth-child(3)
|
||||
animation-delay: 0.5s
|
||||
|
||||
@keyframes blink
|
||||
0%
|
||||
background-color: transparent
|
||||
|
||||
50%
|
||||
background-color: red
|
||||
</style>
|
||||
@@ -1,11 +1,67 @@
|
||||
<template>
|
||||
<div class="navbar" :class="{ 'navbar--hidden': !showNavbar }">
|
||||
<div class="navbar-inner">
|
||||
<div class="navbar-icon">
|
||||
<router-link to="/">
|
||||
<img alt="logo" class="logo" src="/assets/img/vampir.png" />
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="navbar-text">
|
||||
<router-link to="/">Bloodline</router-link>
|
||||
</div>
|
||||
<div class="navbar-center" v-if="!isMobile"></div>
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-navigation mid-text" v-if="!isMobile">
|
||||
<div
|
||||
class="navbar-navigation-link"
|
||||
v-for="link in links"
|
||||
:key="link.name"
|
||||
:class="{ active: link.name === route.name }"
|
||||
@click="router.push(link.path)"
|
||||
>
|
||||
<div class="icon">
|
||||
<img :src="link.icon" alt="" />
|
||||
</div>
|
||||
<div class="text">{{ link.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!isMobile">
|
||||
<div v-if="!address" class="btn btn-immortal mid-text" @click="showPanel = true">Connect</div>
|
||||
<div class="login-icon-desktop mid-text" v-else @click="showPanel = true">
|
||||
<img :src="getblocky(address)" alt="avatar" />
|
||||
<div>{{ getAddressShortName(walletStore.address) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else @click="showPanel = true">
|
||||
<div class="login-icon" v-if="!address">
|
||||
<font-awesome-icon :icon="['fas', 'fa-arrow-right-to-bracket']" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<img :src="getblocky(address)" alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { storeToRefs } from "pinia";
|
||||
import { ref, onMounted, onBeforeUnmount, inject } from "vue";
|
||||
import { useWalletStore } from "@/stores/wallet";
|
||||
const walletStore = useWalletStore();
|
||||
const { connected, address } = storeToRefs(walletStore);
|
||||
const isMobile = inject("isMobile");
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { getblocky, getAddressShortName } from "@/helper/helper.js";
|
||||
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
const emit = defineEmits(["showPanel"]);
|
||||
|
||||
const walletStore = useWalletStoreV2();
|
||||
const { address } = storeToRefs(walletStore);
|
||||
const isMobile = inject("isMobile");
|
||||
const showPanel = inject("showPanel");
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const showNavbar = ref(true);
|
||||
const lastScrollPosition = ref(0);
|
||||
|
||||
@@ -18,6 +74,27 @@ function onScroll() {
|
||||
lastScrollPosition.value = currentScrollPosition;
|
||||
}
|
||||
|
||||
const links = [
|
||||
{
|
||||
title: "Sacrifice",
|
||||
name: "home",
|
||||
path: "/",
|
||||
icon: "/assets/img/sacrifice-icon.png",
|
||||
},
|
||||
{
|
||||
title: "Cycle",
|
||||
name: "cycle",
|
||||
path: "/cycle",
|
||||
icon: "/assets/img/cycle-icon.png",
|
||||
},
|
||||
{
|
||||
title: "Profile",
|
||||
name: "profile",
|
||||
path: "/profile",
|
||||
icon: "/assets/img/profile-icon.png",
|
||||
},
|
||||
];
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener("scroll", onScroll);
|
||||
});
|
||||
@@ -27,109 +104,97 @@ onBeforeUnmount(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header>
|
||||
<div class="navbar" :class="{ 'navbar--hidden': !showNavbar }">
|
||||
<div class="navbar-inner">
|
||||
<div class="navbar-icon">
|
||||
<router-link to="/">
|
||||
<!-- <img alt="Parry logo" class="logo" src="@/assets/img/logo.svg" /> -->
|
||||
<img alt="logo" class="logo" src="@/assets/img/vampir.png" />
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="navbar-text">Bloodline</div>
|
||||
<div class="navbar-center" v-if="!isMobile">
|
||||
<div class="navbar-social-links">
|
||||
<div class="social-bloodline-badge">
|
||||
<div class="social-bloodline-badge-icon">
|
||||
<font-awesome-icon icon="fa-brands fa-discord" />
|
||||
</div>
|
||||
<div class="social-bloodline-badge-text">Discord</div>
|
||||
</div>
|
||||
<div class="social-bloodline-badge">
|
||||
<div class="social-bloodline-badge-icon">
|
||||
<font-awesome-icon icon="fa-brands fa-telegram" />
|
||||
</div>
|
||||
<div class="social-bloodline-badge-text">Telegram</div>
|
||||
</div>
|
||||
<div class="social-bloodline-badge">
|
||||
<div class="social-bloodline-badge-icon">
|
||||
<font-awesome-icon icon="fa-brands fa-twitter" />
|
||||
</div>
|
||||
<div class="social-bloodline-badge-text">Twitter</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<div v-if="!isMobile">
|
||||
<div v-if="!connected" class="btn btn-immortal" @click="walletStore.connectWallet">connect</div>
|
||||
<span v-else> {{ address }}</span>
|
||||
</div>
|
||||
<div v-else class="hamburger-menu">
|
||||
<font-awesome-icon :icon="['fas', 'bars']" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
header
|
||||
.navbar
|
||||
position: fixed
|
||||
z-index: 3
|
||||
.navbar
|
||||
position: fixed
|
||||
z-index: 3
|
||||
box-sizing: border-box
|
||||
background-color: #202020
|
||||
width: 100%
|
||||
transform: translate3d(0,0,0)
|
||||
transition: transform .3s ease,visibility 0s .3s linear
|
||||
height: 82px
|
||||
@media (min-width: 992px)
|
||||
height: 80px
|
||||
// &.navbar--hidden
|
||||
// transform: translate3d(0,-100%,0)
|
||||
.navbar-inner
|
||||
display: flex
|
||||
padding: 16px 24px
|
||||
box-sizing: border-box
|
||||
background-color: #202020
|
||||
width: 100%
|
||||
transform: translate3d(0,0,0)
|
||||
transition: transform .3s ease,visibility 0s .3s linear
|
||||
height: 82px
|
||||
height: 100%
|
||||
align-items: center
|
||||
@media (min-width: 992px)
|
||||
height: 128px
|
||||
&.navbar--hidden
|
||||
transform: translate3d(0,-100%,0)
|
||||
.navbar-inner
|
||||
display: flex
|
||||
padding: 16px 24px
|
||||
box-sizing: border-box
|
||||
height: 100%
|
||||
align-items: center
|
||||
@media (min-width: 992px)
|
||||
padding: 16px 24px
|
||||
.navbar-icon
|
||||
img
|
||||
height: 50px
|
||||
width: 50px
|
||||
.navbar-text
|
||||
font-family: 'Vampire', sans-serif
|
||||
font-size: 36px
|
||||
margin-left: 16px
|
||||
letter-spacing: 0.138em
|
||||
line-height: 73.107px
|
||||
.navbar-icon
|
||||
img
|
||||
height: 50px
|
||||
width: 50px
|
||||
@media (min-width: 992px)
|
||||
font-size: 64px
|
||||
.navbar-center
|
||||
height: 56px
|
||||
width: 56px
|
||||
|
||||
.navbar-text
|
||||
font-family: 'Vampire', sans-serif
|
||||
font-size: 36px
|
||||
margin-left: 16px
|
||||
letter-spacing: 0.138em
|
||||
line-height: 73.107px
|
||||
@media (min-width: 992px)
|
||||
font-size: 42px
|
||||
a
|
||||
text-decoration: none
|
||||
color: white
|
||||
.navbar-center
|
||||
display: flex
|
||||
.navbar-end
|
||||
display: flex
|
||||
margin-left: auto
|
||||
gap: 80px
|
||||
.navbar-navigation
|
||||
display: flex
|
||||
margin-left: auto
|
||||
.navbar-social-links
|
||||
align-items: center
|
||||
gap: 48px
|
||||
.navbar-navigation-link
|
||||
display: flex
|
||||
gap: 18px
|
||||
.social-bloodline-badge
|
||||
font-size: 16px
|
||||
padding: 8px 16px 8px 16px
|
||||
border-radius: 14px
|
||||
background-color: #0F0F0F
|
||||
display: flex
|
||||
&:hover,&:active,&:focus
|
||||
background-color: lighten(#0F0F0F, 10%)
|
||||
cursor: pointer
|
||||
.social-bloodline-badge-icon
|
||||
margin-right: 8px
|
||||
.navbar-end
|
||||
gap: 8px
|
||||
border-bottom: 2px solid transparent
|
||||
&.active
|
||||
border-bottom: 2px solid white
|
||||
&:active, &:hover, &:focus
|
||||
cursor: pointer
|
||||
.icon
|
||||
img
|
||||
width: 20px
|
||||
height: 20px
|
||||
|
||||
|
||||
|
||||
.login-icon
|
||||
color: var(--white)
|
||||
background-color: var(--purple)
|
||||
padding: 8px
|
||||
font-size: 25px
|
||||
border-radius: 8px
|
||||
width: 44px
|
||||
height: 44px
|
||||
display: flex
|
||||
margin-left: auto
|
||||
.hamburger-menu
|
||||
color: var(--purple)
|
||||
font-size: 42px
|
||||
justify-content: center
|
||||
align-items: center
|
||||
img
|
||||
width: 32px
|
||||
height: 32px
|
||||
border-radius: 8px
|
||||
.login-icon-desktop
|
||||
display: flex
|
||||
padding: 8px
|
||||
align-items: center
|
||||
gap: 16px
|
||||
border-radius: 16px
|
||||
background: var(--Background-grey, #2D2D2D)
|
||||
&:hover,&:active,&:focus
|
||||
cursor: pointer
|
||||
img
|
||||
width: 32px
|
||||
height: 32px
|
||||
</style>
|
||||
|
||||
@@ -1,53 +1,38 @@
|
||||
<template>
|
||||
<div class="rewards-wrapper">
|
||||
<div class="rewards-header">
|
||||
<div class="rewards-header-title">
|
||||
{{ props.title }}
|
||||
</div>
|
||||
<div class="rewards-header-info">{{ props.info }}</div>
|
||||
<div class="rewards-headline low-mid-text">
|
||||
{{ props.title }}
|
||||
</div>
|
||||
<div class="rewards-sacrifice-wrapper bloodline-border bloodline-border--variant1">
|
||||
<div class="rewards-body">
|
||||
<div class="rewards-coin">$BLOOD</div>
|
||||
<div class="rewards-amount">0</div>
|
||||
</div>
|
||||
<img class="bloodline-token" :src="props.image" alt="vampir" />
|
||||
<div class="rewards-inner">
|
||||
<token-name-price name="$BLOOD" :price="props.amount"></token-name-price>
|
||||
<token-logo :img="props.image" :alt="'vampire'"></token-logo>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||
import TokenLogo from "@/components/TokenLogo.vue";
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
info: String,
|
||||
amount: [String, Number],
|
||||
image: String,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.rewards-header
|
||||
font-size: 16px
|
||||
padding: 8px
|
||||
.rewards-wrapper
|
||||
display: flex
|
||||
@media (min-width: 992px)
|
||||
font-size: 24px
|
||||
.rewards-header-info
|
||||
margin-left: auto
|
||||
.rewards-sacrifice-wrapper, .rewards-clan-wrapper
|
||||
display: flex
|
||||
.rewards-body
|
||||
align-self: center
|
||||
.rewards-coin
|
||||
font-size: 16px
|
||||
@media (min-width: 992px)
|
||||
font-size: 24px
|
||||
.rewards-amount
|
||||
font-size: 24px
|
||||
margin-top: 8px
|
||||
@media (min-width: 992px)
|
||||
font-size: 40px
|
||||
margin-top: 0
|
||||
img
|
||||
margin-left: auto
|
||||
align-self: center
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
padding: 6px 0
|
||||
.rewards-inner
|
||||
display: flex
|
||||
padding: 0 6px 6px 6px
|
||||
border-bottom: 1px solid var(--grey, #858585)
|
||||
justify-content: space-between
|
||||
height: 56px
|
||||
box-sizing: content-box
|
||||
</style>
|
||||
|
||||
@@ -1,250 +1,473 @@
|
||||
<template>
|
||||
<div class="sacrifice-wrapper card bloodline-wrapper">
|
||||
{{ activeToken.allowance }}
|
||||
|
||||
<div class="sacrifice-inner">
|
||||
<div class="sacrifice-headline">Select Sacrifice</div>
|
||||
<div class="sacrifice-select-tokens">
|
||||
<div class="sacrifice-tokens">
|
||||
<div
|
||||
class="sacrifice-token"
|
||||
:class="[{ 'sacrifice-token--active': token.contractAddress === activeToken.contractAddress }]"
|
||||
v-for="token in props.data"
|
||||
:key="token.contractAddress"
|
||||
@click="tokenStore.changeActiveToken(token)"
|
||||
>
|
||||
<div class="sacrifice-token-logo">
|
||||
<img v-if="isMobile" :src="token.logoMobile" alt="token logo" />
|
||||
<img v-if="!isMobile" :src="token.logo" alt="token logo" />
|
||||
</div>
|
||||
<div class="sacrifice-token-name">{{ token.name }}</div>
|
||||
<div class="sacrifice-wrapper card card--glow">
|
||||
<div class="sacrifice-headline">Select Sacrifice {{ splashBlood }}</div>
|
||||
<div class="sacrifice-select-tokens">
|
||||
<div class="sacrifice-tokens">
|
||||
<div
|
||||
class="sacrifice-token"
|
||||
:class="[
|
||||
{
|
||||
'sacrifice-token--active': token.contractAddress === activeToken.contractAddress,
|
||||
'bloodline-border': token.contractAddress === activeToken.contractAddress,
|
||||
'bloodline-border--variant1': token.contractAddress === activeToken.contractAddress,
|
||||
},
|
||||
]"
|
||||
v-for="token in props.data"
|
||||
:key="token.contractAddress"
|
||||
@click="changeActiveToken(token)"
|
||||
>
|
||||
<div class="sacrifice-token-logo">
|
||||
<img v-if="isMobile" :src="token.logoMobile" alt="token logo" />
|
||||
<img v-if="!isMobile" :src="token.logo" alt="token logo" />
|
||||
</div>
|
||||
<div class="sacrifice-token-name mid-text">{{ token.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sacrifice-from-to-wrapper" v-if="activeToken.contractAddress">
|
||||
<div class="sacrifice-from-wrapper bloodline-border bloodline-border--variant1">
|
||||
<div class="sarcrifice-from-input">
|
||||
<input @input="processChange" v-model="tokenNumber" :placeholder="0" />
|
||||
<div class="sacrifice-logo">
|
||||
<img :src="activeToken.logo" alt="vampir" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="value-adder">
|
||||
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(10000000)">+10m</div>
|
||||
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(100000000)">+100m</div>
|
||||
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(1000000000)">+1b</div>
|
||||
<!-- <div class="sacrifice-adder-balance">Balance: {{ parseFloat(activeToken.balance) }}</div>
|
||||
<div class="sacrifice-adder-max" @click="tokenNumber = parseFloat(activeToken.balance)">
|
||||
Max
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="sacrifice-divider bloodline-devider">
|
||||
<font-awesome-icon :icon="['fas', 'arrow-down']" />
|
||||
</div>
|
||||
<div class="sacrifice-to-wrapper bloodline-border bloodline-border--variant1">
|
||||
<div class="sarcrifice-from-input">
|
||||
<div class="sacrifice-to-output">
|
||||
<div class="sacrifice-to-output-coin">$BLOOD</div>
|
||||
<div class="sacrifice-to-output-rewards">{{ output }}</div>
|
||||
</div>
|
||||
<div class="sacrifice-logo">
|
||||
<img :src="activeToken.vamp.logo" :alt="activeToken.vamp.name" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sacrifice-fees-info-wrapper">
|
||||
<div class="sacrifice-fees-img">
|
||||
<img src="@/assets/img/fuel-noozle.png" alt="fuel noozle" />
|
||||
</div>
|
||||
<div class="sacrifice-fees-body">
|
||||
<div class="sacrifice-fees-body-header">
|
||||
<div class="sacrifice-fees-body-header-title">Gas Support</div>
|
||||
<div class="sacrifice-fees-body-header-amount">42Gwei</div>
|
||||
</div>
|
||||
<div class="sacrifice-fees-body-subheader">Increase amount to pay 97% less network fees.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sacrifice-buttons-function-wrapper">
|
||||
<div v-if="connected">
|
||||
</div>
|
||||
<div class="sacrifice-from-to-wrapper" v-if="activeToken.contractAddress">
|
||||
<div class="sacrifice-from-wrapper bloodline-border bloodline-border--variant1 purple">
|
||||
<token-input
|
||||
:modelValue="sacrificeStore.sacrificeNumber / 10n ** activeToken.decimals"
|
||||
@input="
|
||||
($event) => {
|
||||
const value = BigInt($event.target.value) * 10n ** 18n;
|
||||
sacrificeStore.sacrificeNumber = value;
|
||||
processChange(value);
|
||||
}
|
||||
"
|
||||
:max="activeWalletToken?.balanceOf"
|
||||
:logo="activeToken.logo"
|
||||
>
|
||||
<template v-slot:message>
|
||||
<div
|
||||
class="btn btn-immortal"
|
||||
v-if="activeToken.allowance > 0 && activeToken.allowance >= tokenNumber"
|
||||
@click="approvalData = tokenStore.sacrificeToken(tokenNumber)"
|
||||
class="sacrifice-adder-step bloodline-badge"
|
||||
v-for="steps in activeToken.addSteps"
|
||||
:key="steps.name"
|
||||
@click="addTokens(steps.amount)"
|
||||
>
|
||||
<font-awesome-icon v-if="loading" icon="spinner" spin />
|
||||
Sacrifce {{ activeToken.name }}
|
||||
<template
|
||||
v-if="
|
||||
!walletStore.connected ||
|
||||
sacrificeStore.sacrificeNumber < activeWalletToken?.balanceOf
|
||||
"
|
||||
>
|
||||
+{{ steps.name }}
|
||||
</template>
|
||||
<template v-else> -{{ steps.name }} </template>
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal"
|
||||
v-else
|
||||
@click="approvalData = tokenStore.approveToken(tokenNumber)"
|
||||
>
|
||||
<font-awesome-icon v-if="loading" icon="spinner" spin />
|
||||
Approve {{ activeToken.name }}
|
||||
</template>
|
||||
<template v-slot:message-end v-if="activeWalletToken?.balanceOf">
|
||||
<div class="input-balance tiny-text">
|
||||
Balance:
|
||||
{{ BigInt(activeWalletToken?.balanceOf) / 10n ** activeToken.decimals }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="btn btn-immortal" @click="walletStore.connectWallet">Connect</div>
|
||||
</div>
|
||||
<div class="input-max tiny-text" @click="addMaxTokens">Max</div>
|
||||
</template>
|
||||
</token-input>
|
||||
</div>
|
||||
<div class="bloodline-devider">
|
||||
<font-awesome-icon :icon="['fas', 'arrow-down']" />
|
||||
</div>
|
||||
<div
|
||||
:class="{
|
||||
'sacrifice-to-wrapper': true,
|
||||
'bloodline-border': true,
|
||||
'bloodline-border--variant1': true,
|
||||
purple: output && output > 0,
|
||||
}"
|
||||
>
|
||||
<div class="sacrifice-to-body">
|
||||
<token-name-price name="$BLOOD" :price="`≈${formatNumber(output)}`"></token-name-price>
|
||||
<token-logo :img="activeToken.vamp.logo" :size="64" :alt="activeToken.vamp.name"></token-logo>
|
||||
</div>
|
||||
|
||||
<div class="sacrifice-staking-bonus">
|
||||
<div
|
||||
class="sacrifice-staking-bonus-inner"
|
||||
@click="
|
||||
(e) => {
|
||||
showStakingMenu = !showStakingMenu;
|
||||
}
|
||||
"
|
||||
>
|
||||
<div class="mid-mid-text" v-if="!walletStore.connected">+ Staking Bonus</div>
|
||||
<div
|
||||
class="mid-mid-text"
|
||||
v-else-if="walletStore.memeToken?.staked === 0 || cycleStore.currentCycle === 1"
|
||||
>
|
||||
No Staking Bonus
|
||||
</div>
|
||||
<div class="mid-mid-text" v-else>+ {{ stakingOutput }} Staking Bonus</div>
|
||||
<div class="icon">
|
||||
<font-awesome-icon icon="chevron-down" />
|
||||
</div>
|
||||
</div>
|
||||
<stake-component-v1 :variant="1" v-if="showStakingMenu">
|
||||
<template v-slot:headline> {{ null }}</template>
|
||||
</stake-component-v1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sacrificed-info" v-if="stateComputed === 4">
|
||||
<div class="left low-mid-text">You can claim your $BLOOD when the cycle is finished.</div>
|
||||
<div class="right">
|
||||
<img src="/assets/img/moon.png" alt="moon" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="sacrifice-buttons-function-wrapper">
|
||||
<template v-if="walletStore.connected">
|
||||
<div class="btn btn-immortal sub-header" disabled v-if="stateComputed === 0">Enter Amount</div>
|
||||
<div
|
||||
class="btn btn-immortal sub-header"
|
||||
disabled
|
||||
v-else-if="sacrificeStore.sacrificeNumber > activeWalletToken?.balanceOf"
|
||||
>
|
||||
Insufficient Balance
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal sub-header"
|
||||
v-else-if="
|
||||
activeToken.allowance > 0 &&
|
||||
activeToken.allowance >= sacrificeStore.sacrificeNumber &&
|
||||
(stateComputed === 1 || stateComputed === 4)
|
||||
"
|
||||
@click="sacrificeToken"
|
||||
>
|
||||
Sacrifice 🩸
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal sub-header"
|
||||
v-else-if="
|
||||
(!activeToken.allowance || activeToken.allowance < sacrificeStore.sacrificeNumber) &&
|
||||
(stateComputed === 1 || stateComputed === 4)
|
||||
"
|
||||
@click="approveToken(sacrificeStore.sacrificeNumber)"
|
||||
>
|
||||
Approve Token
|
||||
</div>
|
||||
<div class="btn btn-immortal sub-header" disabled v-else-if="stateComputed === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal sub-header" disabled v-else-if="stateComputed === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="btn btn-immortal sub-header" @click="showPanel = true">Connect</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, defineProps, watch, inject } from "vue";
|
||||
import { useWalletStore } from "@/stores/wallet";
|
||||
import { ref, defineProps, watch, inject, nextTick, onMounted, onBeforeUnmount, computed, markRaw } from "vue";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useUniswapStore } from "@/stores/uniswap";
|
||||
import { useSacrificeStore } from "@/stores/sacrifice";
|
||||
import StakeComponentV1 from "@/components/StakeComponentV1.vue";
|
||||
import LoadingComponent from "@/components/LoadingComponent.vue";
|
||||
import TokenInput from "@/components/TokenInput.vue";
|
||||
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||
import TokenLogo from "@/components/TokenLogo.vue";
|
||||
import ApprovedToast from "@/components/toasts/ApprovedToast.vue";
|
||||
import { useToast } from "vue-toastification";
|
||||
import { storeToRefs } from "pinia";
|
||||
import Helper from "@/utils/helper.js";
|
||||
const isMobile = inject("isMobile");
|
||||
import { waitForTransaction, readContract, watchBlockNumber, multicall } from "@wagmi/core";
|
||||
|
||||
const walletStore = useWalletStore();
|
||||
const { contract, connected } = storeToRefs(walletStore);
|
||||
const cycleStore = useCycleStore();
|
||||
const sacrificeStore = useSacrificeStore();
|
||||
const toast = useToast();
|
||||
|
||||
import { debounce, formatNumber } from "@/helper/helper.js";
|
||||
|
||||
const isMobile = inject("isMobile");
|
||||
const showPanel = inject("showPanel");
|
||||
const splashBlood = inject("splashBlood");
|
||||
|
||||
const walletStore = useWalletStoreV2();
|
||||
|
||||
const tokenStore = useTokenStore();
|
||||
const { activeToken, loading } = storeToRefs(tokenStore);
|
||||
const { activeToken } = storeToRefs(tokenStore);
|
||||
|
||||
const props = defineProps({
|
||||
data: Array,
|
||||
});
|
||||
|
||||
watch(
|
||||
activeToken,
|
||||
() => {
|
||||
tokenNumber.value = null;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
const tokenNumber = ref(0);
|
||||
const output = ref(0);
|
||||
const stakingOutput = ref(null);
|
||||
const blockEvent = ref(null);
|
||||
const approveToast = ref(null);
|
||||
const addOperator = ref(true);
|
||||
const splashesUsed = ref([]);
|
||||
/**
|
||||
* state 0 enter amount
|
||||
* state 1 rdy to go
|
||||
* state 2 signing
|
||||
* state 3 loading
|
||||
* state 4 sacrificed
|
||||
*/
|
||||
const showStakingMenu = ref(false);
|
||||
const approvalData = ref(null);
|
||||
|
||||
const processChange = Helper.debounce((e) => getRewardsFor(e));
|
||||
|
||||
async function getRewardsFor(e) {
|
||||
if (!e.target.value) {
|
||||
output.value = 0;
|
||||
return;
|
||||
const activeWalletToken = computed(() => {
|
||||
let returnedObject = {};
|
||||
if (activeToken.value.contractAddress) {
|
||||
returnedObject = walletStore.token.find((obj) => obj.contractAddress === activeToken.value.contractAddress);
|
||||
}
|
||||
console.log("e.target.value * 18", e.target.value * Math.pow(10, 18));
|
||||
const rewardsForResult = await tokenStore.getRewardsFor(
|
||||
BigInt(e.target.value * Math.pow(10, activeToken.value.decimals))
|
||||
return returnedObject;
|
||||
});
|
||||
|
||||
const stateComputed = computed(() => {
|
||||
let returnState = 0;
|
||||
if (
|
||||
sacrificeStore.sacrificeNumber === null ||
|
||||
sacrificeStore.sacrificeNumber === "" ||
|
||||
sacrificeStore.sacrificeNumber === 0n
|
||||
) {
|
||||
returnState = 0;
|
||||
} else if (sacrificeStore.sacrificeState === 2) {
|
||||
returnState = 2;
|
||||
} else if (sacrificeStore.sacrificeState === 3) {
|
||||
returnState = 3;
|
||||
} else if (
|
||||
sacrificeStore.sacrificeNumber !== null ||
|
||||
sacrificeStore.sacrificeNumber !== "" ||
|
||||
sacrificeStore.sacrificeNumber > 0
|
||||
) {
|
||||
returnState = 1;
|
||||
}
|
||||
return returnState;
|
||||
});
|
||||
const processChange = debounce(async (value) => {
|
||||
const rewardValue = await sacrificeStore.getRewardsFor(value, activeToken.value);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
blockEvent.value = watchBlockNumber(
|
||||
{
|
||||
listen: true,
|
||||
},
|
||||
async (blockNumber) => {
|
||||
console.log("blockNumber", blockNumber);
|
||||
var rewardValue = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
}
|
||||
);
|
||||
output.value = rewardsForResult / Math.pow(10, tokenStore.memeToken.decimals);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
console.log("blockEventunwatch", blockEvent.value);
|
||||
blockEvent.value();
|
||||
});
|
||||
|
||||
async function approveToken(amount) {
|
||||
try {
|
||||
console.log("amount", amount);
|
||||
sacrificeStore.sacrificeState = 2;
|
||||
const hash = await tokenStore.approveToken(amount);
|
||||
sacrificeStore.sacrificeState = 3;
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
console.log("data", data);
|
||||
activeToken.value.allowance = await tokenStore.allowance();
|
||||
sacrificeStore.sacrificeState = 1;
|
||||
approveToast.value = showApprovedToast();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
} finally {
|
||||
sacrificeStore.sacrificeState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async function addTokens(value) {
|
||||
tokenNumber.value = tokenNumber.value + value;
|
||||
output.value = await tokenStore.getRewardsFor(parseInt(tokenNumber.value));
|
||||
if (!walletStore.connected || sacrificeStore.sacrificeNumber < activeWalletToken.value?.balanceOf) {
|
||||
sacrificeStore.sacrificeNumber = BigInt(sacrificeStore.sacrificeNumber) + value;
|
||||
} else {
|
||||
sacrificeStore.sacrificeNumber = sacrificeStore.sacrificeNumber - value;
|
||||
if (sacrificeStore.sacrificeNumber < 0n) {
|
||||
sacrificeStore.sacrificeNumber = 0n;
|
||||
}
|
||||
}
|
||||
|
||||
const rewardValue = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
}
|
||||
|
||||
async function addMaxTokens() {
|
||||
addOperator.value = !addOperator.value;
|
||||
sacrificeStore.sacrificeNumber = activeWalletToken.value?.balanceOf;
|
||||
const rewardValue = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
console.log("rewardValue", rewardValue);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
}
|
||||
|
||||
function showApprovedToast(value, header, subheader, info) {
|
||||
// Define the content object with the component, props and listeners
|
||||
const content = {
|
||||
component: ApprovedToast,
|
||||
// Any prop can be passed, but don't expect them to be reactive
|
||||
props: {
|
||||
value: value,
|
||||
header: header,
|
||||
subheader: subheader,
|
||||
info: info,
|
||||
},
|
||||
// Listen and react to events using callbacks. In this case we listen for
|
||||
// the "click" event emitted when clicking the toast button
|
||||
listeners: {
|
||||
sacrificed: showSplash,
|
||||
},
|
||||
};
|
||||
|
||||
// Render the toast and its contents
|
||||
return toast(content, {
|
||||
position: "top-right",
|
||||
icon: false,
|
||||
closeOnClick: false,
|
||||
// toastClassName: "modal-overlay",
|
||||
hideProgressBar: true,
|
||||
timeout: false,
|
||||
toastClassName: "approve-toast toast-card",
|
||||
});
|
||||
}
|
||||
|
||||
function showSplash() {
|
||||
splashBlood.value++;
|
||||
}
|
||||
|
||||
//call function in the store and remove icon,
|
||||
async function sacrificeToken() {
|
||||
var result = await sacrificeStore.sacrificeToken(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
if (result) {
|
||||
showSplash();
|
||||
}
|
||||
toast.dismiss(approveToast.value);
|
||||
}
|
||||
|
||||
async function changeActiveToken(token) {
|
||||
console.log("changeActiveToken");
|
||||
tokenStore.activeToken = token;
|
||||
if (walletStore.connected) {
|
||||
// //TODO, wenn connected, dann all diese Daten laden?
|
||||
// tokenStore.activeToken.balance = await walletStore.getTokenBalance(token);
|
||||
tokenStore.activeToken.allowance = Number(await tokenStore.allowance());
|
||||
}
|
||||
var rewards = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, token);
|
||||
console.log("rewards", rewards);
|
||||
output.value = rewards.output;
|
||||
stakingOutput.value = rewards.staking;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
|
||||
.sacrifice-wrapper
|
||||
display: flex
|
||||
flex-direction: column
|
||||
margin-left: auto
|
||||
margin-right: auto
|
||||
background-color: var(--primary)
|
||||
.sacrifice-inner
|
||||
padding: 48px 24px
|
||||
padding: 24px
|
||||
align-items: center
|
||||
@media (min-width: 992px)
|
||||
padding: 48px 64px
|
||||
.sacrifice-headline
|
||||
text-align: center
|
||||
font-size: 24px
|
||||
margin-bottom: 32px
|
||||
@media (min-width: 992px)
|
||||
padding: 48px 64px
|
||||
.sacrifice-headline
|
||||
text-align: center
|
||||
font-size: 24px
|
||||
margin-bottom: 32px
|
||||
@media (min-width: 992px)
|
||||
font-size: 36px
|
||||
.sacrifice-select-tokens
|
||||
display: flex
|
||||
margin-bottom: 32px
|
||||
.sacrifice-tokens
|
||||
display: flex
|
||||
width: 100%
|
||||
justify-content: space-between
|
||||
@media (min-width: 992px)
|
||||
justify-content: space-evenly
|
||||
font-size: 32px
|
||||
.sacrifice-select-tokens
|
||||
display: flex
|
||||
margin-bottom: 32px
|
||||
width: 100%
|
||||
.sacrifice-tokens
|
||||
display: flex
|
||||
width: 100%
|
||||
justify-content: space-between
|
||||
flex-wrap: wrap
|
||||
gap: 12px
|
||||
|
||||
.sacrifice-token
|
||||
border-radius: 16px
|
||||
padding: 12px
|
||||
cursor: pointer
|
||||
background-color: #0F0F0F
|
||||
text-align: center
|
||||
@media (min-width: 992px)
|
||||
padding: 0
|
||||
background-color: unset
|
||||
&:hover,
|
||||
&:active,
|
||||
&:focus
|
||||
background-color: var(--tertiary-dark)
|
||||
&.sacrifice-token--active
|
||||
background-color: var(--tertiary-dark)
|
||||
.sacrifice-token-name
|
||||
padding: 5px 26px
|
||||
font-size: 16px
|
||||
@media (min-width: 992px)
|
||||
font-size: 24px
|
||||
|
||||
.sacrifice-buttons-function-wrapper
|
||||
text-align: center
|
||||
justify-content: center
|
||||
margin-top: 24px
|
||||
display: block
|
||||
@media (min-width: 992px)
|
||||
display: flex
|
||||
.btn
|
||||
padding: 16px 64px
|
||||
.sacrifice-fees-info-wrapper
|
||||
display: flex
|
||||
border: 2px dashed var(--grey)
|
||||
color: var(--grey)
|
||||
.sacrifice-token
|
||||
border-radius: 16px
|
||||
padding: 16px 24px
|
||||
margin-top: 24px
|
||||
font-size: 16px
|
||||
.sacrifice-fees-img
|
||||
flex: 0 0 15%
|
||||
.sacrifice-fees-body
|
||||
flex: 1 1 auto
|
||||
.sacrifice-fees-body-header
|
||||
display: flex
|
||||
flex-direction: row
|
||||
justify-content: space-between
|
||||
margin-bottom: 8px
|
||||
@media (min-width: 992px)
|
||||
font-size: 24px
|
||||
margin-bottom: 0
|
||||
padding: 9px
|
||||
cursor: pointer
|
||||
background-color: #0F0F0F
|
||||
text-align: center
|
||||
user-select: none
|
||||
border: 4px solid transparent
|
||||
.sacrifice-token-logo
|
||||
pointer-events: none
|
||||
@media (min-width: 992px)
|
||||
img
|
||||
height: 100px
|
||||
width: 100px
|
||||
// padding: 0
|
||||
// background-color: unset
|
||||
&.sacrifice-token--active
|
||||
border-color: var(--purple)
|
||||
|
||||
.sacrifice-token-name
|
||||
@media (min-width: 992px)
|
||||
padding: 5px 26px
|
||||
|
||||
.sacrifice-buttons-function-wrapper
|
||||
text-align: center
|
||||
justify-content: center
|
||||
display: block
|
||||
@media (min-width: 992px)
|
||||
display: flex
|
||||
.btn
|
||||
padding: 12px 48px
|
||||
.sacrifice-fees-info-wrapper
|
||||
display: flex
|
||||
border: 1px dashed var(--grey)
|
||||
color: var(--grey)
|
||||
border-radius: 16px
|
||||
padding: 12px
|
||||
gap: 12px
|
||||
.sacrifice-fees-img
|
||||
img
|
||||
height: 46px
|
||||
.sacrifice-fees-body
|
||||
flex: 1 1 auto
|
||||
display: flex
|
||||
flex-direction: column
|
||||
justify-content: space-between
|
||||
.sacrifice-fees-body-header
|
||||
display: flex
|
||||
flex-direction: row
|
||||
justify-content: space-between
|
||||
margin-bottom: 8px
|
||||
@media (min-width: 992px)
|
||||
margin-bottom: 0
|
||||
|
||||
.sacrifice-from-to-wrapper
|
||||
.sacrifice-from-wrapper,.sacrifice-to-wrapper
|
||||
.sarcrifice-from-input
|
||||
display: flex
|
||||
margin-bottom: 8px
|
||||
// height: 60px
|
||||
input
|
||||
width: 100%
|
||||
height: 45px
|
||||
font-size: 24px
|
||||
border-radius: 16px
|
||||
padding: 0 16px
|
||||
@media (min-width: 992px)
|
||||
font-size: 32px
|
||||
height: auto
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 16px
|
||||
width: 100%
|
||||
@media (min-width: 992px)
|
||||
gap: 32px
|
||||
.sacrifice-from-wrapper
|
||||
.sacrifice-logo
|
||||
margin-left: 16px
|
||||
img
|
||||
width: 45px
|
||||
height: 45px
|
||||
border-radius: 50%
|
||||
pointer-events: none
|
||||
@media (min-width: 992px)
|
||||
height: 83px
|
||||
height: 100%
|
||||
width: auto
|
||||
.sacrifice-to-output
|
||||
flex: 1 1 auto
|
||||
@@ -261,12 +484,17 @@ async function addTokens(value) {
|
||||
display: flex
|
||||
gap: 6px
|
||||
.sacrifice-adder-step
|
||||
font-size: 14px
|
||||
font-size: 12px
|
||||
align-items: center
|
||||
background: var(--grey, #858585)
|
||||
color: var(--midnight-black, #0F0F0F)
|
||||
&:hover,
|
||||
&:active,
|
||||
&:focus
|
||||
background-color: var(--secondary)
|
||||
background-color: var(--grey-light)
|
||||
cursor: pointer
|
||||
// @media (min-width: 992px)
|
||||
// font-size: 12px
|
||||
// .sacrifice-adder-balance
|
||||
// margin-left: auto
|
||||
// .sacrifice-adder-max
|
||||
@@ -278,4 +506,41 @@ async function addTokens(value) {
|
||||
// color: darken(red, 10%)
|
||||
// transform: scale(1.1)
|
||||
// transition: transform 0s
|
||||
.sacrifice-to-wrapper
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 18px
|
||||
.sacrifice-to-body
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
height: 56px
|
||||
.sacrificed-info
|
||||
display: flex
|
||||
padding: 8px 24px
|
||||
justify-content: space-between
|
||||
align-items: center
|
||||
align-self: stretch
|
||||
border-radius: 16px
|
||||
background: var(--midnight-black, #0F0F0F)
|
||||
text-align: left
|
||||
|
||||
.sacrifice-staking-bonus
|
||||
display: flex
|
||||
flex-direction: column
|
||||
padding: 8px 16px
|
||||
row-gap: 8px
|
||||
border-radius: 10px
|
||||
background: var(--midnight-black, #0F0F0F)
|
||||
.sacrifice-staking-bonus-inner
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
.icon
|
||||
margin-left: auto
|
||||
|
||||
.input-max
|
||||
color: var(--grey, #858585)
|
||||
font-weight: bold
|
||||
&:hover, &:active, &:focus
|
||||
color: var(--grey-light, #858585)
|
||||
cursor: pointer
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div class="slideout-overlay" :class="{ open: props.modelValue }" @click="showPanel = false">
|
||||
<div :class="{ 'slideout-wrapper': true, open: props.modelValue }">
|
||||
<div class="slideout-panel" @click="testClick">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, watchEffect } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
});
|
||||
|
||||
defineEmits(["update:modelValue"]);
|
||||
|
||||
const showPanel = inject("showPanel");
|
||||
|
||||
function testClick(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.slideout-overlay
|
||||
z-index: 100
|
||||
&.open
|
||||
height: 100%
|
||||
width: 100%
|
||||
position: fixed
|
||||
background-color: rgb(15, 15, 15, 0.7)
|
||||
.slideout-wrapper
|
||||
z-index: 100
|
||||
height: 100svh
|
||||
position: fixed
|
||||
display: flex
|
||||
background-color: var(--midnight-black, #0F0F0F)
|
||||
border-radius: 16px
|
||||
transition: margin-bottom 250ms ease 0s
|
||||
width: 100%
|
||||
margin-bottom: -100vh
|
||||
bottom: 0
|
||||
overflow: auto
|
||||
@media (min-width: 992px)
|
||||
margin-right: -400px
|
||||
transition: margin-right 250ms ease 0s
|
||||
width: auto
|
||||
right: -30px
|
||||
top: 0
|
||||
&.open
|
||||
margin-bottom: -82px
|
||||
@media (min-width: 992px)
|
||||
margin-right: 30px
|
||||
.slideout-panel
|
||||
width: 100%
|
||||
height: 100%
|
||||
padding: 24px 24px 16px 24px
|
||||
overflow: scroll
|
||||
height: calc( 100svh - 82px )
|
||||
@media (min-width: 992px)
|
||||
width: 400px
|
||||
overflow: unset
|
||||
.slideout-icon
|
||||
cursor: pointer
|
||||
&:hover, &:active, &:focus
|
||||
background-color: lighten(#2D2D2D, 20%)
|
||||
svg
|
||||
font-size: 30px
|
||||
</style>
|
||||
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{
|
||||
'stake-component--variant1': props.variant === 1,
|
||||
'stake-component--variant2': props.variant === 2,
|
||||
'stake-component--variant3': props.variant === 3,
|
||||
}"
|
||||
>
|
||||
<div class="mid-text text-center" v-if="props.variant === 2">
|
||||
<slot name="headline">Staked</slot>
|
||||
</div>
|
||||
<div
|
||||
class="connected-stake bloodline-border card"
|
||||
:class="{ 'card--dense': dense, 'connected-stake--variant1': variant === 1 }"
|
||||
@click="
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
"
|
||||
>
|
||||
<div class="connected-stake-headline mid-mid-text">
|
||||
<slot name="headline" v-if="variant !== 2">Staked</slot>
|
||||
</div>
|
||||
<div class="connected-stake-subheadline low-mid-text">
|
||||
<slot name="subheadline"
|
||||
>Stake for a 25% bonus on your sacrifice.<br />
|
||||
Upper limit is your stake.</slot
|
||||
>
|
||||
</div>
|
||||
<div class="connected-stake-body">
|
||||
<slot name="body">
|
||||
<token-name-price
|
||||
v-if="walletStore.memeToken?.staked"
|
||||
:name="tokenStore.getToken(walletStore.memeToken?.contractAddress)?.name"
|
||||
:price="formatNumber(walletStore.memeToken?.staked / 10n ** tokenStore.memeToken.decimals)"
|
||||
></token-name-price>
|
||||
<token-logo img="/assets/img/token/bloodline.png" :alt="'bloodline-token'"></token-logo>
|
||||
<token-name-price class="stake-reward" name="Extra Reward" price="+25%"></token-name-price>
|
||||
</slot>
|
||||
</div>
|
||||
<slot name="actions">
|
||||
<div class="connected-stake-buttons" v-if="!stakeMenu">
|
||||
<div class="mid-mid-text text-center" disabled v-if="!walletStore.connected">
|
||||
Please Connect Your Wallet
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal mid-mid-text"
|
||||
disabled
|
||||
v-if="walletStore.connected && cycleStore.currentCycle === 1"
|
||||
>
|
||||
Stake
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal mid-mid-text"
|
||||
v-else-if="walletStore.connected && cycleStore.currentCycle > 1"
|
||||
@click="openStake"
|
||||
>
|
||||
Stake
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
walletStore.connected &&
|
||||
((walletStore.memeToken?.staked === 0 && !stakeonly) || cycleStore.currentCycle === 1)
|
||||
"
|
||||
class="btn btn-immortal btn--disabled mid-mid-text"
|
||||
>
|
||||
Unstake
|
||||
</div>
|
||||
<div
|
||||
v-else-if="walletStore.connected && !stakeonly"
|
||||
class="btn btn-immortal mid-mid-text"
|
||||
@click="openUnstake"
|
||||
>
|
||||
Unstake
|
||||
</div>
|
||||
</div>
|
||||
<Transition name="smooth">
|
||||
<stake-menu
|
||||
v-model="tokenNumber"
|
||||
@close="stakeMenu = false"
|
||||
:stake="stake"
|
||||
:amount="balanceOf"
|
||||
v-if="stakeMenu & !unstakeMenu"
|
||||
>
|
||||
<template v-slot:body>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStake === 0">
|
||||
Enter Amount
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" v-else-if="stateStake === 1" @click="stakeToken">
|
||||
Stake
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStake === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStake === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div
|
||||
class="btn transparent small-text cancel-button text-center"
|
||||
@click="stakeMenu = false"
|
||||
>
|
||||
Cancel
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:message-end>
|
||||
<div class="input-balance">Balance: {{ formatNumber(balanceOf) }}</div>
|
||||
</template>
|
||||
</stake-menu>
|
||||
<div class="unstake-menu" v-else-if="stakeMenu & unstakeMenu">
|
||||
<div class="low-mid-text text-center">
|
||||
To prevent users from farming rewards you can claim your stake next cycle.
|
||||
</div>
|
||||
<div class="unstake-menu-actions">
|
||||
<div class="btn btn-immortal stake-button" v-if="stateStake <= 1" @click="orderUnstake">
|
||||
Unstake Next Cycle
|
||||
</div>
|
||||
<div class="btn btn--disabled mid-mid-text text-center" v-else-if="stateStake === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn--disabled mid-mid-text text-center" v-else-if="stateStake === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="btn transparent small-text cancel-button text-center"
|
||||
@click="stakeMenu = false"
|
||||
>
|
||||
Cancel
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
<div class="connected-stake-first-round small-text text-center" v-if="cycleStore.currentCycle === 0">
|
||||
No $BLOOD on the market. Staking is activated after the first cycle is finished.
|
||||
</div>
|
||||
<div class="connected-stake-first-round small-text text-center" v-else>
|
||||
You can claim your stake next cycle
|
||||
</div>
|
||||
</slot>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, useSlots, computed } from "vue";
|
||||
import StakeMenu from "@/components/StakeMenu.vue";
|
||||
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||
import TokenLogo from "@/components/TokenLogo.vue";
|
||||
import { waitForTransaction } from "@wagmi/core";
|
||||
import LoadingComponent from "@/components/LoadingComponent.vue";
|
||||
import { showSuccessToast } from "@/helper/toast.js";
|
||||
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useToast } from "vue-toastification";
|
||||
import { formatNumber } from "@/helper/helper.js";
|
||||
|
||||
const toast = useToast();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const cycleStore = useCycleStore();
|
||||
const slots = useSlots();
|
||||
const props = defineProps({
|
||||
stakeonly: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
variant: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const stakeMenu = ref(false);
|
||||
const unstakeMenu = ref(false);
|
||||
const stake = ref(null);
|
||||
const tokenNumber = ref(null);
|
||||
const loading = ref(false);
|
||||
|
||||
/**
|
||||
* state 0 enter amount
|
||||
* state 1 rdy to go
|
||||
* state 2 signing
|
||||
* state 3 loading
|
||||
* state 4 staked
|
||||
*/
|
||||
const state = ref(0);
|
||||
|
||||
function openStake() {
|
||||
stake.value = true;
|
||||
unstakeMenu.value = false;
|
||||
stakeMenu.value = true;
|
||||
}
|
||||
|
||||
function openUnstake() {
|
||||
stake.value = false;
|
||||
unstakeMenu.value = true;
|
||||
stakeMenu.value = true;
|
||||
}
|
||||
|
||||
async function orderUnstake() {
|
||||
try {
|
||||
state.value = 2;
|
||||
var hash = await rewardLockerStore.orderUnstake();
|
||||
state.value = 3;
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
state.value = 4;
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
console.log("rewardData", rewardData);
|
||||
|
||||
const outputClaim = Number(rewardData.topics[2]) / 10n ** tokenStore.memeToken.decimals;
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim),
|
||||
"Success!",
|
||||
"You just unstaked",
|
||||
"You can claim your stake next cycle."
|
||||
);
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
console.error("orderUnstake", error);
|
||||
} finally {
|
||||
state.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async function stakeToken() {
|
||||
try {
|
||||
console.log("stakeToken");
|
||||
state.value = 2;
|
||||
const hash = await rewardLockerStore.stakeBloodline(tokenNumber.value);
|
||||
state.value = 3;
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xf496bf2b14b1d178412b6f7a745900105b49b38b315cfdfbfabad31a6f995c6f"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
|
||||
const outputClaim = BigInt(rewardData.topics[3]) / 10n ** tokenStore.memeToken.decimals;
|
||||
console.log("data", data);
|
||||
state.value = 0;
|
||||
await walletStore.loadWalletData();
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim),
|
||||
"Success!",
|
||||
"You just staked",
|
||||
"Your next sacrifice will get an extra staking bonus as a reward."
|
||||
);
|
||||
//reload data
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
} finally {
|
||||
state.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const balanceOf = computed(() => {
|
||||
if (!walletStore.memeToken?.balanceOf) {
|
||||
return 0n;
|
||||
} else {
|
||||
return walletStore.memeToken?.balanceOf / 10n ** tokenStore.memeToken.decimals;
|
||||
}
|
||||
});
|
||||
|
||||
const stateStake = computed(() => {
|
||||
let returnState = 0;
|
||||
if (state.value === 2) {
|
||||
returnState = 2;
|
||||
} else if (state.value === 3) {
|
||||
returnState = 3;
|
||||
} else if (tokenNumber.value !== null || tokenNumber.value !== "" || tokenNumber.value > 0) {
|
||||
returnState = 1;
|
||||
} else if (tokenNumber.value === null || tokenNumber.value === "" || tokenNumber.value === 0) {
|
||||
returnState = 0;
|
||||
}
|
||||
return returnState;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
|
||||
.stake-component--variant2
|
||||
border-radius: 16px
|
||||
background: var(--darkgrey, #202020)
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 18px
|
||||
padding: 8px
|
||||
@media (min-width: 992px)
|
||||
padding: 24px 48px
|
||||
.unstake-menu
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 16px
|
||||
.unstake-menu-actions
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
|
||||
.stake-component--variant3
|
||||
.connected-stake
|
||||
.connected-stake-headline
|
||||
text-align: left
|
||||
.connected-stake-body
|
||||
.token-price-wrapper, .stake-reward
|
||||
.token-name
|
||||
font-size: 14px
|
||||
.token-price
|
||||
font-size: 24px
|
||||
.connected-stake-buttons
|
||||
display: flex
|
||||
gap: 8px
|
||||
.btn
|
||||
font-size: 18px
|
||||
.connected-stake-first-round
|
||||
font-size: 14px
|
||||
.connected-stake-claim-info
|
||||
font-size: 14px
|
||||
</style>
|
||||
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<div class="stake-menu">
|
||||
<token-input :modelValue="props.modelValue" @input="emit('update:modelValue', Number($event.target.value))">
|
||||
<template v-slot:message>
|
||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(25n)">25%</div>
|
||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(50n)">50%</div>
|
||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(75n)">75%</div>
|
||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(100n)">100%</div>
|
||||
</template>
|
||||
<template v-slot:message-end>
|
||||
<slot name="message-end"> </slot>
|
||||
</template>
|
||||
</token-input>
|
||||
<div class="stake-menu-actions">
|
||||
<slot name="body">
|
||||
<div class="input-balance">Balance: {{ walletStore.memeToken.balanceOf }}</div>
|
||||
<div class="btn btn-immortal stake-button" @click="stakeBloodline" v-if="props.stake">Stake</div>
|
||||
<div class="btn btn-immortal stake-button" @click="unstakeBloodline" v-else>Unstake for Next Cycle</div>
|
||||
<div class="btn btn-immortal black" @click="emit('close')">Cancel</div>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import TokenInput from "./TokenInput.vue";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { createPermitObject, getSignatureRSV } from "@/helper/blockchain.js";
|
||||
|
||||
import { signTypedData } from "@wagmi/core";
|
||||
|
||||
const walletStore = useWalletStoreV2();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const props = defineProps({
|
||||
stake: Boolean,
|
||||
modelValue: [Number, BigInt],
|
||||
amount: [Number, BigInt],
|
||||
});
|
||||
|
||||
const emit = defineEmits(["close", "update:modelValue"]);
|
||||
|
||||
async function addTokensPercent(value) {
|
||||
console.log("value", value);
|
||||
console.log("props.amount", props.amount);
|
||||
let amount;
|
||||
if (props.amount !== undefined || props.amount !== null) {
|
||||
console.log("props.amount", props.amount);
|
||||
amount = (props.amount * value) / 100n;
|
||||
} else if (props.stake) {
|
||||
amount = (walletStore.memeToken.balanceOf * value) / 100n;
|
||||
} else {
|
||||
amount = (walletStore.memeToken.staked * value) / 100n;
|
||||
}
|
||||
console.log("amount", amount);
|
||||
emit("update:modelValue", Number(amount));
|
||||
}
|
||||
|
||||
async function unstakeBloodline() {
|
||||
try {
|
||||
const fromAddress = walletStore.address;
|
||||
|
||||
var unstakedOrdered = await rewardLockerStore.contract.read.unstakeOrdered([4, fromAddress]);
|
||||
//check if states needed here
|
||||
var hash = await rewardLockerStore.contract.write.orderUnstake();
|
||||
console.log("hash", hash);
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
console.log("data", data);
|
||||
} catch (error) {
|
||||
console.error("unstakeBloodline", error);
|
||||
}
|
||||
}
|
||||
|
||||
async function stakeBloodline() {
|
||||
try {
|
||||
console.log("stakeBloodline");
|
||||
const fromAddress = walletStore.address;
|
||||
const spender = rewardLockerStore.config.contractAddress;
|
||||
const deadline = Date.now() + 20 * 60;
|
||||
const decimals = tokenStore.getToken(walletStore.memeToken.contractAddress).decimals;
|
||||
const value = BigInt(tokenNumber.value) * 10n ** decimals;
|
||||
const nonce = await tokenStore.memeToken.contract.read.nonces([fromAddress]);
|
||||
const { types, message, domain, primaryType } = createPermitObject(
|
||||
fromAddress,
|
||||
spender,
|
||||
nonce,
|
||||
deadline,
|
||||
value
|
||||
);
|
||||
|
||||
const signature = await signTypedData({
|
||||
domain: domain,
|
||||
message: message,
|
||||
primaryType: primaryType,
|
||||
types: types,
|
||||
});
|
||||
|
||||
const { r, s, v } = getSignatureRSV(signature);
|
||||
|
||||
var resultStake = await rewardLockerStore.contract.write.stakeToBeSecured([value, deadline, v, r, s]);
|
||||
} catch (error) {
|
||||
console.error("stakeBloodline", error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.btn
|
||||
&.btn-immortal
|
||||
&.stake-button
|
||||
font-size: 18px
|
||||
text-align: center
|
||||
.input-balance
|
||||
color: var(--grey, #858585)
|
||||
margin-left: auto
|
||||
|
||||
.stake-menu
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 32px
|
||||
.stake-menu-actions
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
</style>
|
||||
@@ -1,31 +1,110 @@
|
||||
<template>
|
||||
<div class="claim bloodline-border">
|
||||
<div class="rewards-wrapper" v-if="!isMobile">
|
||||
<rewards-wrapper title="Sacrafice Reward" coin="$BLOOD" amount="0" image="/src/assets/img/vampir.png" />
|
||||
<div class="claim bloodline-border bloodline-border__thin grey">
|
||||
<div class="claim-headline sub-header">Your Cycle Rewards</div>
|
||||
|
||||
<!-- <div class="rewards-wrapper" v-if="!isMobile">
|
||||
<rewards-wrapper
|
||||
title="Sacrafice Reward"
|
||||
coin="$BLOOD"
|
||||
:amount="getCurrentCycleData?.rewards_sacrifice"
|
||||
image="/assets/img/vampir.png"
|
||||
/>
|
||||
<div class="rewards-divider bloodline-devider">
|
||||
<font-awesome-icon icon="fa-solid fa-plus" />
|
||||
</div>
|
||||
<rewards-wrapper title="Clan Reward" coin="$BLOOD" amount="0" image="/src/assets/img/vampir.png" />
|
||||
<rewards-wrapper
|
||||
title="Clan Reward"
|
||||
coin="$BLOOD"
|
||||
:amount="getCurrentCycleData?.rewards_clan"
|
||||
image="/assets/img/vampir.png"
|
||||
/>
|
||||
</div> -->
|
||||
<div class="rewards-list">
|
||||
<rewards-wrapper
|
||||
title="Sacrafice Reward"
|
||||
coin="$BLOOD"
|
||||
:amount="formatNumber(rewardsSacrifice)"
|
||||
image="/assets/img/vampir.png"
|
||||
/>
|
||||
<rewards-wrapper
|
||||
title="Staking Bonus"
|
||||
coin="$BLOOD"
|
||||
:amount="formatNumber(rewardsStaking)"
|
||||
image="/assets/img/vampir.png"
|
||||
/>
|
||||
<rewards-wrapper
|
||||
title="Clan Bonus"
|
||||
coin="$BLOOD"
|
||||
:amount="formatNumber(rewardsClan)"
|
||||
image="/assets/img/vampir.png"
|
||||
/>
|
||||
</div>
|
||||
<div class="rewards-list" v-else>
|
||||
<rewards-wrapper
|
||||
title="Total Sacrafice Reward"
|
||||
coin="$BLOOD"
|
||||
amount="0"
|
||||
image="/src/assets/img/vampir.png"
|
||||
/>
|
||||
<rewards-wrapper
|
||||
title="Total Stake Reward"
|
||||
coin="$BLOOD"
|
||||
amount="0"
|
||||
info="max: 312m"
|
||||
image="/src/assets/img/vampir.png"
|
||||
/>
|
||||
<rewards-wrapper title="Clan Bonus" coin="$BLOOD" amount="0" image="/src/assets/img/vampir.png" />
|
||||
<rewards-wrapper title="Total Reward" coin="$BLOOD" amount="0" image="/src/assets/img/vampir.png" />
|
||||
<div class="rewards-total-wrapper">
|
||||
<div class="rewards-total-headline sub-header">Total Reward</div>
|
||||
<div
|
||||
class="rewards-total-inner bloodline-border bloodline-border--variant1"
|
||||
:class="{ purple: rewardsTotal > 0 && activeCycle !== currentCycle }"
|
||||
>
|
||||
<token-name-price name="$BLOOD" :price="formatNumber(rewardsTotal)"></token-name-price>
|
||||
<token-logo img="/assets/img/vampir.png" :alt="'vampire'"></token-logo>
|
||||
</div>
|
||||
</div>
|
||||
<div class="claim-button">
|
||||
<div class="btn btn-immortal" @click="claimRewards">Claim</div>
|
||||
<template v-if="!walletStore.connected">
|
||||
<button class="btn btn-immortal sub-header" @click="showPanel = true">Connect</button>
|
||||
</template>
|
||||
<template v-else-if="activeCycle === currentCycle">
|
||||
<button class="btn btn-immortal sub-header" @click="router.push({ name: 'home' })">Sacrifice</button>
|
||||
</template>
|
||||
<template v-else-if="rewardsTotal > 0">
|
||||
<Transition name="smooth">
|
||||
<div class="stake-buttons" v-show="!stakeMenu">
|
||||
<div class="btn btn-immortal" v-if="stateClaimedComp === 0" @click="claimRewards">Claim</div>
|
||||
<div class="btn btn-immortal" disabled v-if="stateClaimedComp === 2">Sign Transaction</div>
|
||||
<div class="btn btn-immortal" disabled v-if="stateClaimedComp === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div class="btn btn-immortal" @click="openStake">Stake</div>
|
||||
</div>
|
||||
</Transition>
|
||||
<Transition name="smooth">
|
||||
<stake-menu
|
||||
v-model="tokenNumber"
|
||||
@close="stakeMenu = false"
|
||||
:stake="stake"
|
||||
:amount="rewardsTotal"
|
||||
v-if="stakeMenu"
|
||||
>
|
||||
<template v-slot:body>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStakeClaimComp === 0">
|
||||
Enter Amount
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal stake-button"
|
||||
v-else-if="stateStakeClaimComp === 1"
|
||||
@click="stakeAndClaim"
|
||||
>
|
||||
Stake & Claim Rest
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStakeClaimComp === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStakeClaimComp === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div
|
||||
class="btn transparent small-text cancel-button text-center"
|
||||
@click="stakeMenu = false"
|
||||
>
|
||||
Cancel
|
||||
</div>
|
||||
</template>
|
||||
</stake-menu>
|
||||
</Transition>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="btn btn-immortal btn--disabled sub-header">Nothing to claim</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -33,38 +112,214 @@
|
||||
<script setup>
|
||||
import { storeToRefs } from "pinia";
|
||||
import RewardsWrapper from "@/components/RewardsWrapper.vue";
|
||||
import { inject, ref, onMounted } from "vue";
|
||||
import { inject, ref, onMounted, computed } from "vue";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useWalletStore } from "@/stores/wallet";
|
||||
import { useRoundsStore } from "@/stores/rounds";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
import { useRouter } from "vue-router";
|
||||
import StakeMenu from "@/components/StakeMenu.vue";
|
||||
import { waitForTransaction } from "@wagmi/core";
|
||||
import LoadingComponent from "@/components/LoadingComponent.vue";
|
||||
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||
import TokenLogo from "@/components/TokenLogo.vue";
|
||||
import { formatNumber } from "@/helper/helper.js";
|
||||
import { showSuccessToast } from "@/helper/toast.js";
|
||||
|
||||
const rewards = ref(0);
|
||||
const isMobile = inject("isMobile");
|
||||
const showPanel = inject("showPanel");
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const walletStore = useWalletStore();
|
||||
const roundStore = useRoundsStore();
|
||||
const { address } = storeToRefs(walletStore);
|
||||
const { activeRound, getCurrentRoundData } = storeToRefs(roundStore);
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const cycleStore = useCycleStore();
|
||||
const router = useRouter();
|
||||
|
||||
const { activeCycle, currentCycle, getCurrentCycleData, rewardsSacrifice, rewardsStaking, rewardsClan, rewardsTotal } =
|
||||
storeToRefs(cycleStore);
|
||||
|
||||
const stakeMenu = ref(false);
|
||||
const stake = ref(null);
|
||||
const tokenNumber = ref(null);
|
||||
const stateClaim = ref(0);
|
||||
const stateStakeClaim = ref(0);
|
||||
|
||||
async function stakeAndClaim() {
|
||||
try {
|
||||
console.log("stakeAndClaim");
|
||||
console.log(tokenNumber.value);
|
||||
console.log(rewardsTotal.value);
|
||||
stateStakeClaim.value = 2;
|
||||
console.log("hier1");
|
||||
const coefficient = (10000n * BigInt(tokenNumber.value)) / rewardsTotal.value;
|
||||
var hash = await rewardLockerStore.stakeAndClaimCycle(coefficient, cycleStore.activeCycle);
|
||||
console.log("hier2");
|
||||
stateStakeClaim.value = 3;
|
||||
console.log("hash");
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
console.log("data", data);
|
||||
stateStakeClaim.value = 4;
|
||||
//ClaimedReward (address staker, uint256 reward)
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
|
||||
var stakeData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xf496bf2b14b1d178412b6f7a745900105b49b38b315cfdfbfabad31a6f995c6f"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
console.log("stakeData", stakeData);
|
||||
const outputClaim = BigInt(rewardData?.topics[2]) / 10n ** tokenStore.memeToken.decimals;
|
||||
const outputStaked = BigInt(stakeData?.topics[3]) / 10n ** tokenStore.memeToken.decimals;
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim + outputStaked),
|
||||
"Success!",
|
||||
"You just claimed and staked",
|
||||
"Join the next cycle to increase your rewards and win with your clan."
|
||||
);
|
||||
tokenNumber.value = 0;
|
||||
stakeMenu.value = false;
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
console.error("stakeAndClaim", error);
|
||||
} finally {
|
||||
const walletStore = useWalletStoreV2();
|
||||
await walletStore.loadWalletData();
|
||||
console.log("finally1");
|
||||
await cycleStore.fillCycle(activeCycle.value, true);
|
||||
console.log("finally2");
|
||||
stateStakeClaim.value = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function openStake() {
|
||||
stake.value = true;
|
||||
stakeMenu.value = true;
|
||||
}
|
||||
|
||||
onMounted(async () => {});
|
||||
|
||||
function claimRewards() {
|
||||
//todo
|
||||
async function claimRewards() {
|
||||
try {
|
||||
stateClaim.value = 2;
|
||||
console.log("getCurrentCycleData", getCurrentCycleData);
|
||||
console.log("activeCycle.value", activeCycle.value);
|
||||
var hash = await rewardLockerStore.claim([activeCycle.value]);
|
||||
stateClaim.value = 3;
|
||||
console.log("hash", hash);
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
stateClaim.value = 4;
|
||||
// ClaimedReward (address staker, uint256 reward)
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
|
||||
const outputClaim = BigInt(rewardData.topics[2]) / 10n ** tokenStore.memeToken.decimals;
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim),
|
||||
"Success!",
|
||||
"You just claimed",
|
||||
"Join the next cycle to increase your rewards and win with your clan."
|
||||
);
|
||||
|
||||
await cycleStore.fillCycle(activeCycle.value, true);
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
stateClaim.value = 0;
|
||||
throw Error(error);
|
||||
}
|
||||
}
|
||||
|
||||
const stateClaimedComp = computed(() => {
|
||||
let returnState = 0;
|
||||
if (stateClaim.value === 2) {
|
||||
returnState = 2;
|
||||
} else if (stateClaim.value === 3) {
|
||||
returnState = 3;
|
||||
}
|
||||
return returnState;
|
||||
});
|
||||
|
||||
const stateStakeClaimComp = computed(() => {
|
||||
console.log("stateStakeClaimComp");
|
||||
let returnState = 0;
|
||||
if (stateStakeClaim.value === 2) {
|
||||
returnState = 2;
|
||||
} else if (stateStakeClaim.value === 3) {
|
||||
returnState = 3;
|
||||
} else if (tokenNumber.value !== null || tokenNumber.value !== "" || tokenNumber.value > 0) {
|
||||
returnState = 1;
|
||||
} else if (
|
||||
tokenNumber.value === null ||
|
||||
tokenNumber.value === "" ||
|
||||
tokenNumber.value === 0 ||
|
||||
tokenNumber.value > walletStore.unclaimedRewards
|
||||
) {
|
||||
returnState = 0;
|
||||
}
|
||||
return returnState;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.claim
|
||||
display: flex
|
||||
padding: 32px 20px
|
||||
padding: 12px
|
||||
flex-direction: column
|
||||
gap: 16px
|
||||
@media (min-width: 992px)
|
||||
padding: 32px 40px
|
||||
.claim-headline
|
||||
text-align: left
|
||||
.claim-button
|
||||
text-align: center
|
||||
margin-top: 32px
|
||||
.rewards-wrapper
|
||||
.stake-buttons
|
||||
display: flex
|
||||
text-align: center
|
||||
gap: 8px
|
||||
@media (min-width: 992px)
|
||||
gap: 32px
|
||||
// div
|
||||
// flex: 1 1 50%
|
||||
margin-bottom: 16px
|
||||
.rewards-divider
|
||||
text-align: center
|
||||
|
||||
.rewards-total-wrapper
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
.rewards-total-headline
|
||||
text-align: left
|
||||
.rewards-total-inner
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
text-align: left
|
||||
box-sizing: content-box
|
||||
height: 56px
|
||||
.rewards-left
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
.name
|
||||
font-size: 16px
|
||||
.amount
|
||||
font-size: 24px
|
||||
.rewards-right
|
||||
img
|
||||
height: 49px
|
||||
width: 49px
|
||||
border-radius: 50%
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<div class="token-input">
|
||||
<div class="sarcrifice-from-input">
|
||||
<div class="left-side">
|
||||
<input
|
||||
@input="emit('update:modelValue', $event.target.value)"
|
||||
:value="props.modelValue"
|
||||
:placeholder="0"
|
||||
type="number"
|
||||
/>
|
||||
<div class="value-adder">
|
||||
<slot class="value-adder" name="message"></slot>
|
||||
<slot name="message-end"></slot>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-side">
|
||||
<token-logo img="/assets/img/vampir.png" :alt="'vampir'"></token-logo>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import TokenLogo from "@/components/TokenLogo.vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: [String, Number],
|
||||
logo: String,
|
||||
max: Number,
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:modelValue"]);
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.sarcrifice-from-input
|
||||
display: flex
|
||||
margin-bottom: 8px
|
||||
gap: 8px
|
||||
.left-side
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 12px
|
||||
flex: 1 1 auto
|
||||
input
|
||||
width: 100%
|
||||
height: 45px
|
||||
font-size: 24px
|
||||
border-radius: 16px
|
||||
padding: 0 16px
|
||||
&::-webkit-outer-spin-button,
|
||||
&::-webkit-inner-spin-button
|
||||
-webkit-appearance: none
|
||||
margin: 0
|
||||
&[type=number]
|
||||
-moz-appearance: textfield
|
||||
@media (min-width: 992px)
|
||||
font-size: 24px
|
||||
.value-adder
|
||||
display: flex
|
||||
gap: 8px
|
||||
.stake-adder-step
|
||||
padding: 4px 16px
|
||||
color: var(--black)
|
||||
font-size: 12px
|
||||
border-width: 1px
|
||||
border-color: transparent
|
||||
border-style: solid
|
||||
@media (min-width: 992px)
|
||||
font-size: 14px
|
||||
&:hover,&:active, &:focus
|
||||
background-color: var(--grey-light)
|
||||
cursor: pointer
|
||||
.right-side
|
||||
display: flex
|
||||
flex-direction: column
|
||||
height: 45px
|
||||
.sacrifice-logo
|
||||
margin-left: 16px
|
||||
height: 45px
|
||||
img
|
||||
width: 45px
|
||||
height: 45px
|
||||
border-radius: 50%
|
||||
pointer-events: none
|
||||
@media (min-width: 992px)
|
||||
height: 100%
|
||||
width: auto
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="token-logo">
|
||||
<img :src="props.img" :alt="props.alt" :style="{ height: `${size}px`, width: `${size}px` }" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
img: String,
|
||||
alt: String,
|
||||
size: {
|
||||
type: Number,
|
||||
default: 45,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.token-logo
|
||||
height: 100%
|
||||
img
|
||||
border-radius: 50%
|
||||
pointer-events: none
|
||||
@media (min-width: 992px)
|
||||
width: auto
|
||||
height: 100%
|
||||
</style>
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<div class="token-price-wrapper">
|
||||
<div class="token-name small-text">{{ props.name }}</div>
|
||||
<div class="token-price sub-header">{{ props.price }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
name: String,
|
||||
price: [Number, String],
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.token-price-wrapper
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 6px
|
||||
text-align: left
|
||||
</style>
|
||||
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<div class="approve-card">
|
||||
<div class="left-side low-mid-text">
|
||||
Transaction<br />
|
||||
Successful
|
||||
</div>
|
||||
<div class="right-side">
|
||||
<div class="btn btn-immortal tiny-text" v-if="stateComputed === 1" @click="sacrificeClick">
|
||||
Sacrifice 🩸
|
||||
</div>
|
||||
<div class="btn btn-immortal tiny-text" disabled v-if="stateComputed === 2">Sign Transaction</div>
|
||||
<div class="btn btn-immortal tiny-text" disabled v-if="stateComputed === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import LoadingComponent from "@/components/LoadingComponent.vue";
|
||||
import { getCurrentInstance, computed, watch, inject } from "vue";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useSacrificeStore } from "@/stores/sacrifice";
|
||||
|
||||
import CardComponent from "@/components/CardComponent.vue";
|
||||
import { useToast } from "vue-toastification";
|
||||
|
||||
const emit = defineEmits(["sacrificed"]);
|
||||
|
||||
const props = defineProps({
|
||||
value: String,
|
||||
header: String,
|
||||
subheader: String,
|
||||
info: String,
|
||||
});
|
||||
|
||||
const toast = useToast();
|
||||
const tokenStore = useTokenStore();
|
||||
const sacrificeStore = useSacrificeStore();
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
const id = instance.attrs["toast-id"];
|
||||
const splashBlood = inject("splashBlood");
|
||||
|
||||
function closeToast() {
|
||||
toast.dismiss(id);
|
||||
}
|
||||
|
||||
const stateComputed = computed(() => {
|
||||
let returnState = 0;
|
||||
if (
|
||||
sacrificeStore.sacrificeNumber === null ||
|
||||
sacrificeStore.sacrificeNumber === "" ||
|
||||
sacrificeStore.sacrificeNumber === 0
|
||||
) {
|
||||
returnState = 0;
|
||||
} else if (sacrificeStore.sacrificeState === 2) {
|
||||
returnState = 2;
|
||||
} else if (sacrificeStore.sacrificeState === 3) {
|
||||
returnState = 3;
|
||||
} else if (
|
||||
sacrificeStore.sacrificeNumber !== null ||
|
||||
sacrificeStore.sacrificeNumber !== "" ||
|
||||
sacrificeStore.sacrificeNumber > 0
|
||||
) {
|
||||
returnState = 1;
|
||||
}
|
||||
return returnState;
|
||||
});
|
||||
|
||||
async function sacrificeClick() {
|
||||
try {
|
||||
var result = await sacrificeStore.sacrificeToken(sacrificeStore.sacrificeNumber, tokenStore.activeToken);
|
||||
if (result) {
|
||||
emit("sacrificed");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("error", error);
|
||||
} finally {
|
||||
closeToast();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="sass">
|
||||
.Vue-Toastification__container
|
||||
.Vue-Toastification__toast--default
|
||||
&.approve-toast
|
||||
background: transparent
|
||||
&.toast-card
|
||||
padding: 24px 16px
|
||||
border-radius: 10px
|
||||
border: 2px solid var(--dark-purple, #4B0082)
|
||||
background: var(--midnight-black, #0F0F0F)
|
||||
.Vue-Toastification__toast-component-body
|
||||
.approve-card
|
||||
display: flex
|
||||
flex-direction: row
|
||||
display: flex
|
||||
align-items: center
|
||||
gap: 29px
|
||||
</style>
|
||||
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<card-component class="modal-card">
|
||||
<div class="body">
|
||||
<div class="header">
|
||||
<img alt="logo" class="logo" src="/assets/img/vampir.png" />
|
||||
</div>
|
||||
<div class="subheader toast-header">
|
||||
{{ props.header }}<br />
|
||||
{{ props.subheader }}
|
||||
</div>
|
||||
<div class="amount-number">
|
||||
<div class="token-amount number-mobile">{{ props.value }}</div>
|
||||
<div class="token-name">$Blood</div>
|
||||
</div>
|
||||
<div class="info toast-body">
|
||||
{{ props.info }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn btn-immortal" @click="closeToast">Okay</div>
|
||||
</card-component>
|
||||
</template>
|
||||
<script setup>
|
||||
import { getCurrentInstance } from "vue";
|
||||
|
||||
import CardComponent from "@/components/CardComponent.vue";
|
||||
import { useToast } from "vue-toastification";
|
||||
|
||||
const props = defineProps({
|
||||
value: String,
|
||||
header: String,
|
||||
subheader: String,
|
||||
info: String,
|
||||
});
|
||||
|
||||
// element.classList.add("toast-open");
|
||||
const toast = useToast();
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
instance.parent.parent.vnode.el.classList.add("toast-open");
|
||||
const id = instance.attrs["toast-id"];
|
||||
function closeToast() {
|
||||
instance.parent.parent.vnode.el.classList.remove("toast-open");
|
||||
toast.dismiss(id);
|
||||
}
|
||||
console.log("instance", instance.attrs["toast-id"]);
|
||||
</script>
|
||||
<style lang="sass">
|
||||
.Vue-Toastification__container
|
||||
&.toast-open
|
||||
background-color: rgb(15, 15, 15, 0.7)
|
||||
height: 100vh
|
||||
width: 100vw
|
||||
position: fixed
|
||||
left: 0
|
||||
bottom: 0
|
||||
z-index: 10
|
||||
@media (min-width: 992px)
|
||||
background-color: unset
|
||||
&.top-center
|
||||
@media (min-width: 600px)
|
||||
left: unset
|
||||
margin-left: unset
|
||||
.Vue-Toastification__toast
|
||||
max-width: unset
|
||||
min-width: unset
|
||||
max-height: unset
|
||||
min-height: unset
|
||||
font-family: unset
|
||||
margin-bottom: unset
|
||||
box-shadow: unset
|
||||
padding: unset
|
||||
&.modal-overlay
|
||||
background-color: unset
|
||||
.modal-card
|
||||
width: 342px
|
||||
text-align: center
|
||||
position: absolute
|
||||
top: 50%
|
||||
left: 50%
|
||||
transform: translate(-50%, -50%)
|
||||
border: 2px solid var(--dark-purple, #4B0082)
|
||||
background: var(--midnight-black, #0F0F0F)
|
||||
z-index: 100
|
||||
gap: 16px
|
||||
@media (min-width: 992px)
|
||||
top: 142px
|
||||
right: 24px
|
||||
left: unset
|
||||
transform: unset
|
||||
.body
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 8px
|
||||
.amount-number
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-items: end
|
||||
gap: 8px
|
||||
img
|
||||
width: 74px
|
||||
height: 74px
|
||||
</style>
|
||||
@@ -0,0 +1,72 @@
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
|
||||
export function createPermitObject(fromAddress, spender, nonce, deadline, value) {
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const message = {
|
||||
owner: fromAddress,
|
||||
spender: spender,
|
||||
nonce: nonce,
|
||||
deadline: deadline,
|
||||
value: value,
|
||||
};
|
||||
|
||||
const domainType = [
|
||||
{ name: "name", type: "string" },
|
||||
{ name: "version", type: "string" },
|
||||
{ name: "chainId", type: "uint256" },
|
||||
{ name: "verifyingContract", type: "address" },
|
||||
];
|
||||
|
||||
|
||||
const primaryType = "Permit";
|
||||
|
||||
const types = {
|
||||
EIP712Domain: domainType,
|
||||
Permit: [
|
||||
{
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
name: "spender",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
name: "value",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
name: "nonce",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
name: "deadline",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const domain = {
|
||||
name: "Bloodline",
|
||||
version: "1",
|
||||
chainId: 5,
|
||||
verifyingContract: tokenStore.memeToken.contractAddress,
|
||||
};
|
||||
|
||||
return {
|
||||
types,
|
||||
message,
|
||||
domain,
|
||||
primaryType,
|
||||
};
|
||||
}
|
||||
|
||||
export function getSignatureRSV(sig) {
|
||||
// splits the signature to r, s, and v values.
|
||||
// const pureSig = sig.replace("0x", "");
|
||||
const r = sig.slice(0, 66);
|
||||
const s = "0x" + sig.slice(66, 130);
|
||||
const v = Number("0x" + sig.slice(130, 132));
|
||||
return { v, r, s };
|
||||
};
|
||||
@@ -4,9 +4,7 @@ export function getImageUrl(url) {
|
||||
}
|
||||
|
||||
export function getPercentage(amount, goal) {
|
||||
console.log("amount", amount);
|
||||
console.log("goal", goal);
|
||||
return ((amount / goal) * 100).toFixed(2);
|
||||
return ((Number(amount) / Number(goal)) * 100).toFixed(2);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,4 +13,74 @@ export function compactNumber(number) {
|
||||
notation: "compact",
|
||||
maximumFractionDigits: 2,
|
||||
}).format(parseInt(number));
|
||||
}
|
||||
|
||||
|
||||
export function formatNumber(number) {
|
||||
const options = {
|
||||
style: "decimal",
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 0,
|
||||
};
|
||||
if (!number) {
|
||||
return 0
|
||||
}
|
||||
const formattedWithOptions = number.toLocaleString("en-US", options);
|
||||
return formattedWithOptions;
|
||||
}
|
||||
|
||||
// input type bigint
|
||||
export function formatBigIntDivision(nominator, denominator) {
|
||||
const integer = (nominator / denominator).toString();
|
||||
// pick how much digits after point to show
|
||||
const fraction = (nominator % denominator).toString().substring(0,10);
|
||||
// output type string
|
||||
return integer + '.' + fraction;
|
||||
}
|
||||
|
||||
export function getAddressShortName(address) {
|
||||
// const address = "0x66422602B2f4885c57EE794174f98d9E4DDBBBC6";
|
||||
const addressBegin = address.substring(0, 6);
|
||||
const addressEnd = address.substring(address.length - 4, address.length)
|
||||
return addressBegin + "..." + addressEnd;
|
||||
}
|
||||
|
||||
|
||||
export function numberWithCommas(x, ) {
|
||||
x = x.toString();
|
||||
var pattern = /(-?\d+)(\d{3})/;
|
||||
while (pattern.test(x)) x = x.replace(pattern, "$1,$2");
|
||||
return x;
|
||||
}
|
||||
|
||||
export function getblocky(address) {
|
||||
var blockiesData = blockies
|
||||
.create({
|
||||
seed: address.toLowerCase(),
|
||||
size: 8,
|
||||
scale: 4,
|
||||
})
|
||||
.toDataURL();
|
||||
|
||||
return blockiesData;
|
||||
}
|
||||
|
||||
export function debounce(func, timeout = 300) {
|
||||
let timer;
|
||||
return (...args) => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
return func.apply(this, args);
|
||||
}, timeout);
|
||||
};
|
||||
}
|
||||
|
||||
export function createDebounce() {
|
||||
let timeout = null;
|
||||
return function (fnc, delayMs) {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
fnc();
|
||||
}, delayMs || 500);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import StakeSuccessToast from "@/components/toasts/StakeSuccessToast.vue";
|
||||
import { useToast } from "vue-toastification";
|
||||
const toast = useToast();
|
||||
|
||||
export function showSuccessToast(value, header, subheader, info) {
|
||||
|
||||
// Define the content object with the component, props and listeners
|
||||
const content = {
|
||||
component: StakeSuccessToast,
|
||||
// Any prop can be passed, but don't expect them to be reactive
|
||||
props: {
|
||||
value: value,
|
||||
header: header,
|
||||
subheader: subheader,
|
||||
info: info,
|
||||
},
|
||||
// Listen and react to events using callbacks. In this case we listen for
|
||||
// the "click" event emitted when clicking the toast button
|
||||
listeners: {},
|
||||
};
|
||||
|
||||
// Render the toast and its contents
|
||||
toast(content, {
|
||||
position: "top-center",
|
||||
icon: false,
|
||||
closeOnClick: false,
|
||||
toastClassName: "modal-overlay",
|
||||
closeButton: false,
|
||||
hideProgressBar: true,
|
||||
timeout: false,
|
||||
});
|
||||
}
|
||||
@@ -1,9 +1,33 @@
|
||||
import './assets/sass/main.sass'
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useUniswapStore } from "@/stores/uniswap";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
||||
|
||||
import {
|
||||
createConfig,
|
||||
configureChains,
|
||||
getNetwork,
|
||||
watchAccount,
|
||||
watchContractEvent,
|
||||
watchNetwork,
|
||||
getWalletClient,
|
||||
} from "@wagmi/core";
|
||||
import { WalletConnectConnector } from "@wagmi/core/connectors/walletConnect";
|
||||
import { MetaMaskConnector } from "@wagmi/core/connectors/metaMask";
|
||||
import { CoinbaseWalletConnector } from "@wagmi/core/connectors/coinbaseWallet";
|
||||
import { InjectedConnector } from "@wagmi/core/connectors/injected";
|
||||
|
||||
import { goerli, mainnet } from "@wagmi/core/chains";
|
||||
import { publicProvider } from "@wagmi/core/providers/public";
|
||||
import { alchemyProvider } from "@wagmi/core/providers/alchemy";
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
@@ -14,20 +38,189 @@ import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||
|
||||
/* import specific icons */
|
||||
import { faArrowDown, faSpinner ,faPlus, faCaretLeft, faCaretRight, faBars } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faArrowDown, faArrowRight, faSpinner, faPlus, faCaretLeft, faCaretRight, faBars, faAnglesRight, faChevronDown, faChevronUp, faArrowRightToBracket, faArrowRightFromBracket, faDroplet, faMoon, faPerson, faWallet } from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
import { faDiscord, faTwitter, faTelegram } from "@fortawesome/free-brands-svg-icons";
|
||||
|
||||
import Toast from "vue-toastification";
|
||||
// Import the CSS or use your own!
|
||||
import "vue-toastification/dist/index.css";
|
||||
|
||||
/* add icons to the library */
|
||||
library.add(faArrowDown, faDiscord, faTwitter, faTelegram, faSpinner, faPlus, faCaretLeft, faCaretRight, faBars);
|
||||
library.add(
|
||||
faArrowDown,
|
||||
faArrowRight,
|
||||
faDiscord,
|
||||
faTwitter,
|
||||
faTelegram,
|
||||
faSpinner,
|
||||
faPlus,
|
||||
faCaretLeft,
|
||||
faCaretRight,
|
||||
faBars,
|
||||
faAnglesRight,
|
||||
faArrowRightToBracket,
|
||||
faArrowRightFromBracket,
|
||||
faChevronDown,
|
||||
faChevronUp,
|
||||
faDroplet,
|
||||
faMoon,
|
||||
faPerson,
|
||||
faWallet
|
||||
);
|
||||
|
||||
var logging = localStorage.getItem("LOGGING");
|
||||
if (logging === "true") {
|
||||
} else {
|
||||
if (!window.console) window.console = {};
|
||||
var methods = ["log", "debug", "warn", "info"];
|
||||
for (let i = 0; i < methods.length; i++) {
|
||||
console[methods[i]] = function () {};
|
||||
}
|
||||
}
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
|
||||
const pinia = createPinia();
|
||||
pinia.use(piniaPluginPersistedstate);
|
||||
|
||||
app.use(pinia);
|
||||
|
||||
|
||||
|
||||
app.use(Toast, {
|
||||
transition: "Vue-Toastification__fade",
|
||||
containerClassName: "bloodline-toast-container",
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const cycleStore = useCycleStore();
|
||||
const uniswapStore = useUniswapStore();
|
||||
|
||||
const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
||||
const projectId = "d8e5ecb0353c02e21d4c0867d4473ac5";
|
||||
console.log("hier chains");
|
||||
const { chains, publicClient, webSocketPublicClient } = configureChains(
|
||||
[goerli, mainnet],
|
||||
[alchemyProvider({ apiKey: goerliKey }), publicProvider()]
|
||||
);
|
||||
|
||||
walletStore.config = createConfig({
|
||||
autoConnect: true,
|
||||
connectors: [
|
||||
new CoinbaseWalletConnector({
|
||||
chains,
|
||||
options: {
|
||||
appName: "wagmi demo",
|
||||
},
|
||||
}),
|
||||
new MetaMaskConnector({ chains }),
|
||||
new InjectedConnector({
|
||||
chains,
|
||||
getProvider: () => (typeof window !== "undefined" ? window.myInjectedWallet : undefined),
|
||||
}),
|
||||
new WalletConnectConnector({
|
||||
chains,
|
||||
options: {
|
||||
projectId: projectId,
|
||||
showQrModal: true,
|
||||
metadata: {
|
||||
name: "Bloodline-App",
|
||||
description: "TODO Bloodline Description",
|
||||
url: "https://gitea.loseyourip.com/",
|
||||
icons: ["https://gitea.loseyourip.com/assets/img/vampir.png"],
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
publicClient,
|
||||
webSocketPublicClient,
|
||||
});
|
||||
walletStore.publicClient = publicClient;
|
||||
|
||||
watchContractEvent(
|
||||
{
|
||||
address: memeBurnerStore.config.contractAddress,
|
||||
abi: memeBurnerStore.config.abi,
|
||||
eventName: "MemeSacrificed",
|
||||
},
|
||||
async (log) => {
|
||||
console.log("memeSacrificedEvent", log);
|
||||
const token = log[0].args.sacrificedToken;
|
||||
await cycleStore.updateCurrentCycle(token);
|
||||
}
|
||||
);
|
||||
|
||||
watchContractEvent(
|
||||
{
|
||||
address: rewardLockerStore.config.contractAddress,
|
||||
abi: rewardLockerStore.config.abi,
|
||||
eventName: "CycleCompleted",
|
||||
},
|
||||
async (log) => {
|
||||
console.log("CycleCompleted", log);
|
||||
await cycleStore.fillCycle(cycleStore.currentCycle, true);
|
||||
cycleStore.currentCycle++;
|
||||
await cycleStore.fillCycle(cycleStore.currentCycle, true);
|
||||
}
|
||||
);
|
||||
|
||||
watchAccount(async (account) => {
|
||||
console.log("watchAccount", account);
|
||||
|
||||
// {chainId: }
|
||||
if (account.address) {
|
||||
walletStore.address = account.address;
|
||||
walletStore.connected = true;
|
||||
let chainObject = walletStore.chain;
|
||||
if (!walletStore.chain) {
|
||||
const { chain, chains } = getNetwork();
|
||||
chainObject = chain;
|
||||
}
|
||||
var walletClient = await getWalletClient({
|
||||
account: account.address,
|
||||
chainId: chainObject.id,
|
||||
});
|
||||
|
||||
walletStore.walletClient = walletClient;
|
||||
|
||||
await memeBurnerStore.init();
|
||||
await tokenStore.initV2();
|
||||
await rewardLockerStore.init();
|
||||
await walletStore.loadWalletData();
|
||||
// console.log("cycleStore.currentCycle", cycleStore.currentCycle);
|
||||
// await cycleStore.fillCycle(cycleStore.currentCycle);
|
||||
await uniswapStore.init();
|
||||
} else {
|
||||
walletStore.address = null;
|
||||
walletStore.connected = false;
|
||||
walletStore.walletClient = null;
|
||||
}
|
||||
});
|
||||
|
||||
watchNetwork((network) => {
|
||||
if (network.chain) {
|
||||
walletStore.chain = network.chain;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
await walletStore.init();
|
||||
await tokenStore.initV2();
|
||||
await memeBurnerStore.init();
|
||||
await rewardLockerStore.init();
|
||||
await memeBurnerStore.init();
|
||||
} catch (error) {
|
||||
console.error("main-init", error)
|
||||
}
|
||||
|
||||
app.use(router)
|
||||
app.component('font-awesome-icon', FontAwesomeIcon)
|
||||
app.mount('#app')
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -22,7 +24,42 @@ const router = createRouter({
|
||||
name: "Test",
|
||||
component: () => import("../views/TestView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/wagmi",
|
||||
name: "Wagmi",
|
||||
component: () => import("../views/WagmiView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/profile",
|
||||
name: "profile",
|
||||
meta: {
|
||||
middleware: ["connected"],
|
||||
},
|
||||
component: () => import("../views/ProfileView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/cycle",
|
||||
name: "cycle",
|
||||
meta: {
|
||||
middleware: ["connected"],
|
||||
},
|
||||
component: () => import("../views/CycleView.vue"),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
router.beforeEach(async (to, from) => {
|
||||
//init
|
||||
|
||||
|
||||
const walletStore = useWalletStoreV2();
|
||||
//middleware
|
||||
// if (to.meta.middleware) {
|
||||
// if (!walletStore.connected) {
|
||||
// return '/';
|
||||
// }
|
||||
// }
|
||||
return true;
|
||||
});
|
||||
|
||||
export default router
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { defineStore } from "pinia";
|
||||
export const useContractStore = defineStore("contracts", {
|
||||
state: () => ({
|
||||
list: {
|
||||
|
||||
}
|
||||
}),
|
||||
getters: {
|
||||
},
|
||||
actions: {
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,224 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { useMemeburnerStore } from "./memeburner";
|
||||
import { useTokenStore } from "./tokens";
|
||||
import { useRewardLockerStore } from "./rewardlocker";
|
||||
import { useWalletStoreV2 } from "./walletV2";
|
||||
import { multicall } from "@wagmi/core";
|
||||
|
||||
|
||||
export const useCycleStore = defineStore("cycles", {
|
||||
state: () => ({
|
||||
cycles: [],
|
||||
activeCycle: null,
|
||||
currentCycle: null,
|
||||
}),
|
||||
getters: {
|
||||
//cycle winner is the token who reached the goal
|
||||
//todo winner is now in the cycle object, no reason for that function anymore
|
||||
getCycleWinner() {
|
||||
const goal = this.getCurrentCycleData?.goal;
|
||||
if (!goal) {
|
||||
return;
|
||||
}
|
||||
const winnerCoin = this.cycles[this.activeCycle]?.token.find((token) => token.amount === goal);
|
||||
if (winnerCoin) {
|
||||
return winnerCoin;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
getCurrentCycleData() {
|
||||
return this.cycles[this.activeCycle];
|
||||
},
|
||||
rewardsSacrifice() {
|
||||
const tokenStore = useTokenStore();
|
||||
if (!this.cycles[this.activeCycle]?.rewards_sacrifice) {
|
||||
return 0n;
|
||||
}
|
||||
return this.cycles[this.activeCycle]?.rewards_sacrifice / 10n ** tokenStore.memeToken.decimals;
|
||||
},
|
||||
rewardsStaking() {
|
||||
const tokenStore = useTokenStore();
|
||||
if (!this.cycles[this.activeCycle]?.rewards_staking) {
|
||||
return 0n;
|
||||
}
|
||||
return this.cycles[this.activeCycle]?.rewards_staking / 10n ** tokenStore.memeToken.decimals;
|
||||
},
|
||||
rewardsClan() {
|
||||
const tokenStore = useTokenStore();
|
||||
if (!this.cycles[this.activeCycle]?.rewards_clan) {
|
||||
return 0n;
|
||||
}
|
||||
return this.cycles[this.activeCycle]?.rewards_clan / 10n ** tokenStore.memeToken.decimals;
|
||||
},
|
||||
rewardsTotal() {
|
||||
const tokenStore = useTokenStore();
|
||||
if (!this.cycles[this.activeCycle]?.rewards_total) {
|
||||
return 0n;
|
||||
}
|
||||
return this.cycles[this.activeCycle]?.rewards_total / 10n ** tokenStore.memeToken.decimals;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
//todo check if still needed
|
||||
// async loadRewardsCycles() {
|
||||
// const walletStore = useWalletStoreV2();
|
||||
// const rewardLockerStore = useRewardLockerStore();
|
||||
|
||||
// console.log("this.currentCycle", this.currentCycle);
|
||||
// const contracts = [];
|
||||
// for (let index = 0; index < this.currentCycle; index++) {
|
||||
// console.log("load cycle: " + index);
|
||||
// console.log({ index, address: walletStore.address });
|
||||
// contracts.push({
|
||||
// ...rewardLockerStore.contract,
|
||||
// functionName: "getTotalRewardsOf",
|
||||
// args: [walletStore.address, [index + 1]],
|
||||
// });
|
||||
// }
|
||||
|
||||
// const data = await multicall({
|
||||
// contracts,
|
||||
// });
|
||||
// for (let index = 0; index < data.length; index++) {
|
||||
// const element = data[index];
|
||||
// if (!this.cycles[index]) {
|
||||
// this.cycles[index] = {};
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
//todo check if needed, or use fillcycle
|
||||
async updateCurrentCycle(sacrificedToken) {
|
||||
console.log("updateCurrentCycle");
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
// TODO: Could be combined in one multicall and could be simplified to request data only for sacrificedToken
|
||||
var data = await memeBurnerStore.getSacrificedCycle(this.currentCycle);
|
||||
var tokenTotalSacrificed = await rewardLockerStore.getTotalSacrificeRewardsForAllToken(this.currentCycle);
|
||||
console.log("this.currentCycle", this.currentCycle);
|
||||
console.log("this.cycles", this.cycles);
|
||||
if (this.cycles[this.currentCycle]) {
|
||||
var tokenIndex = this.cycles[this.currentCycle].token.findIndex(
|
||||
(tokenData) => tokenData.contractAddress === sacrificedToken
|
||||
);
|
||||
this.cycles[this.currentCycle].token[tokenIndex].amount = data[tokenIndex].result[1];
|
||||
// was missed update totalSacrificeRewards for sacrificedToken
|
||||
this.cycles[this.currentCycle].token[tokenIndex].amountInBLD = tokenTotalSacrificed[tokenIndex].result;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* main function to fill a round, will not be filled when already loaded
|
||||
* you can use the refillcycle to overwrite information, because if you claim or stake the values will change
|
||||
*/
|
||||
async fillCycle(cycleNumber, refillCycle = false) {
|
||||
console.log("fillCycle", cycleNumber);
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const tokenStore = useTokenStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
if (!this.cycles[cycleNumber]?.goal || refillCycle || !this.cycles[cycleNumber]?.connected) {
|
||||
console.log("fill cycle");
|
||||
|
||||
//multicall getSacrificedMeme for each token for this cycle
|
||||
var data = await memeBurnerStore.getSacrificedCycle(cycleNumber);
|
||||
let rewardData = null;
|
||||
|
||||
if (walletStore.connected) {
|
||||
//getRewards multicall for all tokens
|
||||
rewardData = await rewardLockerStore.getRewardsForAllToken(cycleNumber);
|
||||
}
|
||||
|
||||
console.log("hier");
|
||||
//getTotalSacrificeRewardsForToken multicall for all tokens
|
||||
const tokenTotalSacrificed = await rewardLockerStore.getTotalSacrificeRewardsForAllToken(cycleNumber);
|
||||
console.log("hier1");
|
||||
var goal = await memeBurnerStore.getGoal(cycleNumber);
|
||||
console.log("hier123");
|
||||
var tokenArray = [];
|
||||
var rewards_clan = 0n;
|
||||
var rewards_sacrifice = 0n;
|
||||
var rewards_staking = 0n;
|
||||
|
||||
console.log("hier123");
|
||||
for (let index = 0; index < data.length; index++) {
|
||||
var tokenData = {};
|
||||
const token = tokenStore.token[index];
|
||||
//why no multicall? todo
|
||||
var coefficent = await rewardLockerStore.getSacrificedTokenCoefficient(
|
||||
cycleNumber,
|
||||
token.contractAddress
|
||||
);
|
||||
console.log("coefficent", coefficent);
|
||||
tokenData.name = token.name;
|
||||
tokenData.contractAddress = token.contractAddress;
|
||||
tokenData.vamplogo = token.vamp.logo;
|
||||
tokenData.vampwinner = token.vamp.winner;
|
||||
tokenData.vampwinner2 = token.vamp.winner2;
|
||||
tokenData.vampname = token.vamp.name;
|
||||
tokenData.amount = data[index].result[1];
|
||||
tokenData.amountInBLD = tokenTotalSacrificed[index].result;
|
||||
|
||||
if (walletStore.connected) {
|
||||
//if user is connected fill user specific data for the token
|
||||
const sacrificeClanReward = rewardData[index].result[1];
|
||||
let clanwin = 0n;
|
||||
if (cycleNumber !== this.currentCycle) {
|
||||
// previous version would not work due to missing remainder
|
||||
clanwin = (sacrificeClanReward * coefficent / 10000n) - sacrificeClanReward;
|
||||
console.log("clanwin", clanwin);
|
||||
}
|
||||
const sacrificeRewards = sacrificeClanReward;
|
||||
|
||||
tokenData.rewards_ges = rewardData[index].result[1] + rewardData[index].result[0];
|
||||
|
||||
tokenData.rewards_clan = clanwin;
|
||||
|
||||
tokenData.rewards_staking = rewardData[index].result[0];
|
||||
tokenData.rewards_sacrifice = sacrificeRewards;
|
||||
|
||||
console.log("rewards_clan", rewards_clan);
|
||||
console.log("tokenData.rewards_clan", tokenData.rewards_clan);
|
||||
console.log("tokenData.rewards_sacrifice", tokenData.rewards_sacrifice);
|
||||
rewards_clan = rewards_clan + tokenData.rewards_clan;
|
||||
rewards_sacrifice = rewards_sacrifice + tokenData.rewards_sacrifice;
|
||||
rewards_staking = rewards_staking + tokenData.rewards_staking;
|
||||
}
|
||||
tokenArray.push(tokenData);
|
||||
}
|
||||
|
||||
const goalDecimal = goal[0];
|
||||
const winner = tokenArray.find((token) => token.amount === goalDecimal);
|
||||
const goalInBLD = await memeBurnerStore.getGoalInBLOOD(cycleNumber);
|
||||
//replace vamplogo cause it will automatically change the token for the cycle view (new design)
|
||||
if (winner) {
|
||||
winner.vamplogo = winner.vampwinner;
|
||||
}
|
||||
this.cycles[cycleNumber] = {
|
||||
goal: goal[0],
|
||||
goalInBLD: goalInBLD,
|
||||
expirationTimestamp: goal[2],
|
||||
rewards_clan: rewards_clan,
|
||||
rewards_staking: rewards_staking,
|
||||
rewards_sacrifice: rewards_sacrifice,
|
||||
rewards_total: rewards_clan + rewards_sacrifice + rewards_staking,
|
||||
token: tokenArray,
|
||||
connected: walletStore.connected,
|
||||
winner: winner,
|
||||
};
|
||||
console.log("this.cycles[cycleNumber]", this.cycles[cycleNumber]);
|
||||
} else {
|
||||
console.log("cycle already filled");
|
||||
}
|
||||
},
|
||||
async getFinshedCycleNumbers() {
|
||||
const array = [];
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const lastCompletedCycle = await rewardLockerStore.lastCompletedCycle();
|
||||
// Question: cycle 0 doesn't exist, does it make sense to start from index 1?
|
||||
for (let index = 0; index <= Number(lastCompletedCycle); index++) {
|
||||
array.push(index);
|
||||
}
|
||||
return array;
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,36 +1,119 @@
|
||||
import { defineStore } from "pinia";
|
||||
import MemeBurnerJson from "@/assets/contracts/MemeBurner.json";
|
||||
import MemeAltarJson from "@/assets/contracts/MemeAltar.json";
|
||||
import { useTokenStore } from "./tokens";
|
||||
import { useMultiCallStore } from "./multicall";
|
||||
import { useWalletStoreV2 } from "./walletV2";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
|
||||
import { multicall, getContract, fetchToken, waitForTransaction, getWalletClient } from "@wagmi/core";
|
||||
|
||||
|
||||
export const useMemeburnerStore = defineStore("memeburner", {
|
||||
state: () => ({
|
||||
config: MemeBurnerJson,
|
||||
config: MemeAltarJson,
|
||||
contract: null,
|
||||
loading: false,
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
async getCurrentRound() {
|
||||
return await this.contract.methods.currentRound().call();
|
||||
async init() {
|
||||
console.log("-----------init memeburner-------------");
|
||||
const walletStore = useWalletStoreV2();
|
||||
// const cycleStore = useCycleStore();
|
||||
console.log("walletStore.walletClient", walletStore.walletClient);
|
||||
this.contract = getContract({
|
||||
address: this.config.contractAddress,
|
||||
abi: this.config.abi,
|
||||
walletClient: walletStore.walletClient || walletStore.publicClient,
|
||||
});
|
||||
console.log("this.contract", this.contract);
|
||||
},
|
||||
async getGoal (roundnumber) {
|
||||
return await this.contract.methods.rounds(roundnumber).call();
|
||||
async getRewardFor(amount) {
|
||||
const tokenStore = useTokenStore();
|
||||
const rewards = await this.contract.read.getRewardForSacrifice([
|
||||
tokenStore.activeToken.contractAddress,
|
||||
amount,
|
||||
]);
|
||||
console.log("amount", amount);
|
||||
console.log("rewards", rewards);
|
||||
return rewards;
|
||||
},
|
||||
async getCurrentCycle() {
|
||||
return await this.contract.read.currentCycle();
|
||||
},
|
||||
async getGoal(cycleNumber) {
|
||||
console.log("hier123", cycleNumber);
|
||||
return await this.contract.read.cycles([cycleNumber]);
|
||||
},
|
||||
//returns participated, amount achieved
|
||||
async getSacrificedMeme(roundnumber, tokenAddress) {
|
||||
return await this.contract.methods.getSacrificedMeme(roundnumber, tokenAddress).call();
|
||||
async getSacrificedMeme(cycleNumber, tokenAddress) {
|
||||
return await this.contract.read.getSacrificedMeme([cycleNumber, tokenAddress]);
|
||||
},
|
||||
async getSacrificedRound(roundnumber) {
|
||||
console.log("getSacrificedRound", roundnumber);
|
||||
const tokenStore = useTokenStore();
|
||||
const calls = [];
|
||||
for (let index = 0; index < tokenStore.token.length; index++) {
|
||||
const token = tokenStore.token[index];
|
||||
calls.push(this.contract.methods.getSacrificedMeme(roundnumber, token.contractAddress));
|
||||
}
|
||||
const multicallStore = useMultiCallStore();
|
||||
return await multicallStore.aggregate(calls);
|
||||
async getAmountToReachGoal(tokenAddress) {
|
||||
return await this.contract.read.getAmountToReachGoal([tokenAddress]);
|
||||
},
|
||||
async getSacrificedCycle(cycleNumber) {
|
||||
console.log("getSacrificedCycle", cycleNumber);
|
||||
const tokenStore = useTokenStore();
|
||||
const contracts = [];
|
||||
for (let index = 0; index < tokenStore.sacrificeToken.length; index++) {
|
||||
const token = tokenStore.sacrificeToken[index];
|
||||
contracts.push({
|
||||
...this.contract,
|
||||
functionName: "getSacrificedMeme",
|
||||
args: [cycleNumber, token.contractAddress],
|
||||
});
|
||||
}
|
||||
// console.log("this.contract", this.contract);
|
||||
// const multicallStore = useMultiCallStore();
|
||||
// return await multicallStore.aggregate(calls);
|
||||
const data = await multicall({
|
||||
contracts,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
async sacrificeMeme(amount, minETH) {
|
||||
const tokenStore = useTokenStore();
|
||||
try {
|
||||
if (!amount || amount == 0) {
|
||||
//todo error
|
||||
console.error("amount is 0 or null or undefined");
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
|
||||
},
|
||||
var hash = await this.contract.write.sacrificeMeme([
|
||||
tokenStore.activeToken.contractAddress,
|
||||
amount,
|
||||
minETH
|
||||
]);
|
||||
return hash;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
async sacrificeMemeAndBuyBLOOD(amount, minBLOOD) {
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const amountDecimal = BigInt(amount) * 10n ** BigInt(tokenStore.activeToken.decimals);
|
||||
var hash = await this.contract.write.sacrificeMemeAndBuyBLOOD([
|
||||
tokenStore.activeToken.contractAddress,
|
||||
amountDecimal.toString(),
|
||||
minBLOOD.toString()
|
||||
]);
|
||||
return hash;
|
||||
},
|
||||
async getGoalInBLOOD(cycleNumber) {
|
||||
return await this.contract.read.getGoalInBLOOD([cycleNumber]);
|
||||
},
|
||||
async getAmountETHBase(amount) {
|
||||
console.log("getAmountETHBase");
|
||||
const tokenStore = useTokenStore();
|
||||
return await this.contract.read.getAmountETHBase([tokenStore.activeToken.contract.address, amount, true]);
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import { defineStore } from "pinia";
|
||||
import MulticallJson from "@/assets/contracts/Multicall.json";
|
||||
import { useWalletStore } from "./wallet";
|
||||
|
||||
|
||||
export const useMultiCallStore = defineStore("multicall", {
|
||||
state: () => ({
|
||||
config: MulticallJson,
|
||||
contract: null,
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
async aggregate(calls, parameters = {}) {
|
||||
const callRequests = calls.map((call) => {
|
||||
const callData = call.encodeABI();
|
||||
return {
|
||||
target: call._parent._address,
|
||||
callData,
|
||||
};
|
||||
});
|
||||
|
||||
const { returnData } = await this.contract.methods.aggregate(callRequests).call(parameters);
|
||||
|
||||
return returnData.map((hex, index) => {
|
||||
const types = calls[index]._method.outputs.map((o) =>
|
||||
o.internalType !== o.type && o.internalType !== undefined ? o : o.type
|
||||
);
|
||||
const walletStore = useWalletStore();
|
||||
|
||||
let result = walletStore.web3.eth.abi.decodeParameters(types, hex);
|
||||
|
||||
delete result.__length__;
|
||||
|
||||
result = Object.values(result);
|
||||
return result.length === 1 ? result[0] : result;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -1,45 +1,181 @@
|
||||
import { defineStore } from "pinia";
|
||||
import RewardLockerJson from "@/assets/contracts/RewardLocker.json";
|
||||
import { useTokenStore } from "./tokens";
|
||||
import { useMultiCallStore } from "./multicall";
|
||||
import { useWalletStore } from "./wallet";
|
||||
import { useWalletStoreV2 } from "./walletV2";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
import { createPermitObject, getSignatureRSV } from "@/helper/blockchain.js";
|
||||
import { multicall, getContract, signTypedData, getAccount, waitForTransaction } from "@wagmi/core";
|
||||
|
||||
|
||||
export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||
state: () => ({
|
||||
config: RewardLockerJson,
|
||||
contract: null,
|
||||
ethcontract: null,
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
async init() {
|
||||
console.log("-----------init rewardlocker-------------");
|
||||
const walletStore = useWalletStoreV2();
|
||||
this.contract = getContract({
|
||||
address: this.config.contractAddress,
|
||||
abi: this.config.abi,
|
||||
walletClient: walletStore.walletClient || walletStore.publicClient,
|
||||
});
|
||||
},
|
||||
/*
|
||||
* @param {*} walletAddress
|
||||
* @param {*} roundNumber
|
||||
* @param {*} cycleNumber
|
||||
* @param {*} tokenAddress
|
||||
* @returns Rewards for specific token and specific round
|
||||
* @returns Rewards for specific token and specific cycle
|
||||
*/
|
||||
async getRewards(walletAddress, roundNumber, tokenAddress) {
|
||||
return await this.contract.methods.rewards(walletAddress, roundNumber, tokenAddress).call();
|
||||
},
|
||||
async getRewardsForAllToken(roundNumber) {
|
||||
console.log("getRewardsForAllToken");
|
||||
const tokenStore = useTokenStore();
|
||||
const walletStore = useWalletStore();
|
||||
const calls = [];
|
||||
for (let index = 0; index < tokenStore.token.length; index++) {
|
||||
const token = tokenStore.token[index];
|
||||
calls.push(this.contract.methods.rewards(walletStore.address, roundNumber, token.contractAddress));
|
||||
async getRewards(walletAddress, cycleNumber, tokenAddress) {
|
||||
try {
|
||||
// rewards function doesn't exist, getRewards instead
|
||||
return await this.contract.read.getRewards([walletAddress, cycleNumber, tokenAddress]);
|
||||
} catch (error) {
|
||||
console.error("getRewards", error);
|
||||
}
|
||||
const multicallStore = useMultiCallStore();
|
||||
return await multicallStore.aggregate(calls);
|
||||
},
|
||||
async lastCompletedRound() {
|
||||
return await this.contract.methods.lastCompletedRound().call();
|
||||
async getRewardsForAllToken(cycleNumber) {
|
||||
console.log("getRewardsForAllToken");
|
||||
const tokenStore = useTokenStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const contracts = [];
|
||||
for (let index = 0; index < tokenStore.sacrificeToken.length; index++) {
|
||||
const token = tokenStore.sacrificeToken[index];
|
||||
// calls.push(this.contract.methods.rewards(walletStore.address, cycleNumber, token.contractAddress));
|
||||
contracts.push({
|
||||
...this.contract,
|
||||
functionName: "getRewards",
|
||||
args: [walletStore.address, cycleNumber, token.contractAddress],
|
||||
});
|
||||
}
|
||||
const data = await multicall({
|
||||
contracts,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
async claim(round) {
|
||||
return await this.contract.methods.claim(round).call();
|
||||
async getTotalSacrificeRewardsForAllToken(cycleNumber) {
|
||||
try {
|
||||
const tokenStore = useTokenStore();
|
||||
const contracts = [];
|
||||
for (let index = 0; index < tokenStore.sacrificeToken.length; index++) {
|
||||
const token = tokenStore.sacrificeToken[index];
|
||||
contracts.push({
|
||||
...this.contract,
|
||||
functionName: "getTotalSacrificeRewardsForToken",
|
||||
args: [cycleNumber, token.contractAddress],
|
||||
});
|
||||
}
|
||||
const data = await multicall({
|
||||
contracts,
|
||||
});
|
||||
// const multicallStore = useMultiCallStore();
|
||||
return data;
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
},
|
||||
async getTotalRewardsOf(address, rounds) {
|
||||
return await this.contract.methods.getTotalRewardsOf(address, rounds).call();
|
||||
async getSacrificedTokenCoefficient(cycleNumber, sacrificedToken) {
|
||||
return await this.contract.read.getSacrificedTokenCoefficient([cycleNumber, sacrificedToken]);
|
||||
},
|
||||
async getStakeRewardForSacrificeReward(sacrificedToken, reward) {
|
||||
const walletStore = useWalletStoreV2();
|
||||
const cycleStore = useCycleStore();
|
||||
return await this.contract.read.getStakeRewardForSacrificeReward([
|
||||
walletStore.address,
|
||||
sacrificedToken,
|
||||
reward,
|
||||
]);
|
||||
|
||||
},
|
||||
async lastCompletedCycle() {
|
||||
return await this.contract.read.lastCompletedCycle();
|
||||
},
|
||||
async claim(cycle) {
|
||||
console.log("claim");
|
||||
return await this.contract.write.claim([cycle]);
|
||||
},
|
||||
async claimAll() {
|
||||
console.log("claimAll");
|
||||
const cycleStore = useCycleStore();
|
||||
const account = getAccount();
|
||||
console.log("acocunt", account);
|
||||
|
||||
const cycles = await cycleStore.getFinshedCycleNumbers();
|
||||
return await this.contract.write.claim([cycles]);
|
||||
},
|
||||
async getTotalRewardsOf(address, cycles) {
|
||||
return await this.contract.read.getTotalRewardsOf([address, cycles]);
|
||||
},
|
||||
async getTotalRewards(address) {
|
||||
const cycleStore = useCycleStore();
|
||||
const cycles = await cycleStore.getFinshedCycleNumbers();
|
||||
return await this.contract.read.getTotalRewardsOf([address, cycles]);
|
||||
},
|
||||
async getStaked(address) {
|
||||
return await this.contract.read.staked([address]);
|
||||
},
|
||||
async getUnstakeOrdered(address, cycleNumber) {
|
||||
// returns unstake amount of BDL ordered and ready to be unstaked in a cycleNumber
|
||||
return await this.contract.read.unstakeOrdered([cycleNumber,address]);
|
||||
},
|
||||
async orderUnstake() {
|
||||
return await this.contract.write.orderUnstake();
|
||||
},
|
||||
async unstake(unstakeCycle) {
|
||||
return await this.contract.write.unstake([unstakeCycle]);
|
||||
},
|
||||
async stakeBloodline(tokenNumber) {
|
||||
console.log("tokenNumber", tokenNumber);
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const fromAddress = walletStore.address;
|
||||
const spender = this.config.contractAddress;
|
||||
// timestamp is denominated in seconds
|
||||
const deadline = BigInt(Date.now()) / 1000n + 1200n;
|
||||
const decimals = tokenStore.getToken(walletStore.memeToken.contractAddress).decimals;
|
||||
const value = BigInt(tokenNumber) * 10n ** decimals;
|
||||
const nonce = await tokenStore.memeToken.contract.read.nonces([fromAddress]);
|
||||
console.log("nonce", nonce);
|
||||
const { types, message, domain, primaryType } = createPermitObject(
|
||||
fromAddress,
|
||||
spender,
|
||||
nonce,
|
||||
deadline,
|
||||
value
|
||||
);
|
||||
|
||||
const signature = await signTypedData({
|
||||
domain: domain,
|
||||
message: message,
|
||||
primaryType: primaryType,
|
||||
types: types,
|
||||
});
|
||||
|
||||
const { r, s, v } = getSignatureRSV(signature);
|
||||
console.log("value, deadline, v, r, s", value, deadline, v, r, s);
|
||||
const hash = await this.contract.write.stakeToBeSecured([value, deadline, v, r, s]);
|
||||
return hash;
|
||||
},
|
||||
async stakeAndClaimCycle(stakeCoefficient, cycle) {
|
||||
// stakeCoefficient 25% = 2500, 50% = 5000
|
||||
const tokenStore = useTokenStore();
|
||||
const addresses = tokenStore.sacrificeToken.map((obj) => obj.contractAddress);
|
||||
const hash = await this.contract.write.stakeAndClaim([stakeCoefficient, [cycle], addresses]);
|
||||
return hash;
|
||||
},
|
||||
async stakeAndClaimAllCycles(stakeCoefficient) {
|
||||
console.log("stakeAndClaimAllCycles", stakeCoefficient);
|
||||
const tokenStore = useTokenStore();
|
||||
const cycleStore = useCycleStore();
|
||||
const cycles = await cycleStore.getFinshedCycleNumbers();
|
||||
const addresses = tokenStore.sacrificeToken.map((obj) => obj.contractAddress);
|
||||
const hash = await this.contract.write.stakeAndClaim([stakeCoefficient, cycles, addresses]);
|
||||
return hash;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { useMemeburnerStore } from "./memeburner";
|
||||
import { useTokenStore } from "./tokens";
|
||||
import { useRewardLockerStore } from "./rewardlocker";
|
||||
|
||||
|
||||
export const useRoundsStore = defineStore("rounds", {
|
||||
state: () => ({
|
||||
rounds: [
|
||||
],
|
||||
activeRound: null,
|
||||
currentRound: null
|
||||
}),
|
||||
getters: {
|
||||
getCurrentRoundData() {
|
||||
return this.rounds[this.activeRound];
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async updateCurrentRound(sacrificedToken, sacrificedAmount) {
|
||||
const tokenStore = useTokenStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var data = await memeBurnerStore.getSacrificedRound(this.currentRound)
|
||||
var tokenIndex = this.rounds[this.currentRound].token.findIndex((tokenData) => tokenData.contractAddress === sacrificedToken);
|
||||
this.rounds[this.currentRound].token[tokenIndex].amount = data[tokenIndex][1];
|
||||
},
|
||||
async fillRound() {
|
||||
console.log("fillRound");
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const tokenStore = useTokenStore();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
|
||||
// if (this.activeRound === this.currentRound) {
|
||||
// console.log("activeRound is not completed");
|
||||
// } else
|
||||
if (!this.rounds[this.activeRound]) {
|
||||
console.log("round not filled --> fill round");
|
||||
var data = await memeBurnerStore.getSacrificedRound(this.activeRound)
|
||||
var rewardData = await rewardLockerStore.getRewardsForAllToken(this.activeRound);
|
||||
var goal = await memeBurnerStore.getGoal(this.activeRound);
|
||||
console.log("data", data);
|
||||
var tokenArray = []
|
||||
for (let index = 0; index < data.length; index++) {
|
||||
var tokenData = {};
|
||||
const token = tokenStore.token[index];
|
||||
console.log("token", token);
|
||||
tokenData.name = token.name;
|
||||
tokenData.contractAddress = token.contractAddress;
|
||||
tokenData.vamplogo = token.vamp.logo;
|
||||
tokenData.vampname = token.vamp.name;
|
||||
tokenData.amount = data[index][1];
|
||||
tokenData.rewards = rewardData[index]
|
||||
tokenArray.push(tokenData);
|
||||
}
|
||||
this.rounds[this.activeRound] = {
|
||||
goal: goal, token: tokenArray
|
||||
}
|
||||
} else {
|
||||
console.log("round already filled");
|
||||
}
|
||||
console.log("this.rounds123", this.rounds);
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,209 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useUniswapStore } from "@/stores/uniswap";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
|
||||
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { waitForTransaction, readContract, watchBlockNumber, multicall } from "@wagmi/core";
|
||||
import { showSuccessToast } from "@/helper/toast.js";
|
||||
import { formatNumber, formatBigIntDivision } from "@/helper/helper.js";
|
||||
|
||||
export const useSacrificeStore = defineStore("sacrifice", {
|
||||
state: () => ({
|
||||
sacrificeNumber: 0n,
|
||||
sacrificeState: 0,
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
async sacrificeToken(amount, token) {
|
||||
console.log("sacrificeToken", { amount, token });
|
||||
|
||||
const memeburnerStore = useMemeburnerStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const tokenStore = useTokenStore();
|
||||
const cycleStore = useCycleStore();
|
||||
|
||||
|
||||
try {
|
||||
this.sacrificeState = 2;
|
||||
console.log("hier");
|
||||
const getRewards = await this.getRewardsFor(amount, token);
|
||||
console.log("hier1");
|
||||
console.log("getRewards", getRewards);
|
||||
let hash = null;
|
||||
if (getRewards.variant === "sacrifice") {
|
||||
console.log("sacrifice");
|
||||
hash = await memeburnerStore.sacrificeMeme(amount, getRewards.minETH);
|
||||
console.log("hash", hash);
|
||||
} else {
|
||||
console.log("buy");
|
||||
hash = await memeburnerStore.sacrificeMemeAndBuyBLOOD(amount, getRewards.minBLOOD);
|
||||
console.log("hash", hash);
|
||||
}
|
||||
|
||||
this.sacrificeState = 3;
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
onReplaced: (transaction) => console.log("check transaction canceled", transaction),
|
||||
});
|
||||
console.log("data", data);
|
||||
|
||||
// var rewardData = data.logs.find((logObject) => {
|
||||
// return logObject.topics.find(
|
||||
// (topic) => topic === "0x5e60ccd3c81486143d815dce24867a494d7fee585a0a44282cf479b19a5186ee"
|
||||
// );
|
||||
// });
|
||||
|
||||
var rewardData = data.logs.filter((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0x5e60ccd3c81486143d815dce24867a494d7fee585a0a44282cf479b19a5186ee"
|
||||
);
|
||||
});
|
||||
console.log("rewardData", rewardData);
|
||||
//output
|
||||
let outputSacrifice = rewardData.reduce((x, y) => {
|
||||
return x + BigInt(y.data);
|
||||
}, 0n);
|
||||
outputSacrifice = formatBigIntDivision(outputSacrifice, 10n ** token.decimals);
|
||||
|
||||
console.log("outputSacrifice", outputSacrifice);
|
||||
token.allowance = await tokenStore.allowance();
|
||||
this.sacrificeState = 4;
|
||||
|
||||
showSuccessToast(
|
||||
outputSacrifice,
|
||||
"Success!",
|
||||
"You turned your meme into:",
|
||||
"You can claim once the current cycle is finished and your clan bonus was calculated."
|
||||
);
|
||||
await walletStore.loadWalletData();
|
||||
console.log("cycleStore.currentCycle", cycleStore.currentCycle);
|
||||
await cycleStore.fillCycle(cycleStore.currentCycle, true);
|
||||
return true;
|
||||
} catch (error) {
|
||||
//we should show the user an issue
|
||||
throw new Error(error);
|
||||
} finally {
|
||||
this.sacrificeState = 0;
|
||||
}
|
||||
},
|
||||
async getRewardsFor(amount, token) {
|
||||
console.log("getRewardsFor", {amount, token});
|
||||
const memeburnerStore = useMemeburnerStore();
|
||||
const uniswapStore = useUniswapStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
let output = 0;
|
||||
|
||||
let minBLOOD;
|
||||
|
||||
try {
|
||||
|
||||
if (!amount) {
|
||||
this.sacrificeState = 0;
|
||||
return output;
|
||||
}
|
||||
const amountETHBase = await memeburnerStore.getAmountETHBase(amount);
|
||||
// take 99.5% of amount ETH got for selling meme, 0.5% allowed slippage
|
||||
const minETH = (amountETHBase[1] * 995n) / 1000n;
|
||||
|
||||
const rewardsForResult = await memeburnerStore.getRewardFor(amount);
|
||||
const rewardsForResultSum = rewardsForResult[0] + rewardsForResult[1];
|
||||
// quote blood amount against ETH base amount
|
||||
var quoteRewards = await uniswapStore.quoteExactInputSingle(amount, amountETHBase[0]);
|
||||
|
||||
let variant = "sacrifice";
|
||||
if (quoteRewards.result) {
|
||||
// take 99.5% of quoted amount, 0.5% allowed slippage
|
||||
minBLOOD = quoteRewards.amount * 995n / 1000n;
|
||||
|
||||
if (quoteRewards.amount * 95n / 100n > rewardsForResultSum) {
|
||||
variant = "buy";
|
||||
console.log("use Buy-function", {
|
||||
quoteRewardsNumber: quoteRewards.amount,
|
||||
rewardsForResultSum,
|
||||
});
|
||||
} else {
|
||||
console.log("use sacrifice-function", {
|
||||
quoteRewardsNumber: quoteRewards.amount,
|
||||
rewardsForResultSum,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* case 4
|
||||
* quoter threw an error
|
||||
*/
|
||||
//
|
||||
output = rewardsForResultSum;
|
||||
}
|
||||
console.log("variant", variant);
|
||||
console.log("amount", amount);
|
||||
if (!walletStore.connected || (walletStore.connected && token.allowance < amount)) {
|
||||
/**
|
||||
* case 1
|
||||
* user is not logged in or Allowance is less than Input, then I show getRewardsForSacrifice Value
|
||||
* variante not relevant
|
||||
*/
|
||||
output = rewardsForResultSum;
|
||||
if (variant === "buy") {
|
||||
output = quoteRewards.amount
|
||||
}
|
||||
} else if (walletStore.connected && variant === "sacrifice") {
|
||||
/**
|
||||
* case 2
|
||||
* user is logged in and allowance is greater or equal input and variant is sacrifice
|
||||
*/
|
||||
output = rewardsForResultSum;
|
||||
} else if (walletStore.connected && variant === "buy") {
|
||||
/**
|
||||
* case 3
|
||||
* user is logged in and allowance is greater or equal input and variant is buy
|
||||
* compare sacrificeMeme-result and sacrificeMemeAndBuyBLOOD-result
|
||||
*/
|
||||
const amountSacrifice = await readContract({
|
||||
address: memeburnerStore.contract.address,
|
||||
abi: memeburnerStore.contract.abi,
|
||||
functionName: "sacrificeMeme",
|
||||
args: [token.contractAddress, amount.toString(), minETH.toString()],
|
||||
account: walletStore.address,
|
||||
});
|
||||
|
||||
const amountBuy = await readContract({
|
||||
address: memeburnerStore.contract.address,
|
||||
abi: memeburnerStore.contract.abi,
|
||||
functionName: "sacrificeMemeAndBuyBLOOD",
|
||||
args: [token.contractAddress, amount.toString(), minBLOOD.toString()],
|
||||
account: walletStore.address,
|
||||
});
|
||||
|
||||
if (amountBuy * 95n / 100n > amountSacrifice) {
|
||||
variant = "buy";
|
||||
output = amountBuy;
|
||||
console.log("use buy after comparison sacrificeMemeAndBuyBLOOD and sacrificeMeme");
|
||||
} else {
|
||||
variant = "sacrifice";
|
||||
output = amountSacrifice;
|
||||
console.log("use sacrifice after comparison sacrificeMemeAndBuyBLOOD and sacrificeMeme");
|
||||
}
|
||||
}
|
||||
//potential staking rewards
|
||||
let stakingRewardsNumber = 0;
|
||||
if (output > 0 && walletStore.connected) {
|
||||
const stakingReward = await rewardLockerStore.getStakeRewardForSacrificeReward(
|
||||
token.contractAddress,
|
||||
output
|
||||
);
|
||||
stakingRewardsNumber = stakingReward / 10n ** token.decimals
|
||||
}
|
||||
const outputNumber = output / 10n ** BigInt(token.decimals);
|
||||
return { output: outputNumber, variant: variant, minETH: minETH, minBLOOD: minBLOOD, staking: stakingRewardsNumber };
|
||||
} catch (error) {
|
||||
console.error("getRewardsFor", error);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,49 +1,132 @@
|
||||
import { defineStore } from "pinia";
|
||||
import Web3 from "web3";
|
||||
import { useWalletStore } from "./wallet";
|
||||
import { useContractStore } from "./contracts";
|
||||
import { markRaw } from "vue";
|
||||
import { useWalletStoreV2 } from "./walletV2";
|
||||
import { useMemeburnerStore } from "./memeburner";
|
||||
import Meme1Json from "@/assets/contracts/Meme1.json";
|
||||
import Meme2Json from "@/assets/contracts/Meme2.json";
|
||||
import MemeToken from "@/assets/contracts/MemeToken.json";
|
||||
import MemeBurnerJson from "@/assets/contracts/MemeBurner.json";
|
||||
import Meme3Json from "@/assets/contracts/Meme3.json";
|
||||
import Meme4Json from "@/assets/contracts/Meme4.json";
|
||||
import Meme5Json from "@/assets/contracts/Meme5.json";
|
||||
import BloodlineJson from "@/assets/contracts/Bloodline.json";
|
||||
import { multicall, getContract, fetchToken, getWalletClient, waitForTransaction } from "@wagmi/core";
|
||||
|
||||
|
||||
export const useTokenStore = defineStore("token", {
|
||||
state: () => ({
|
||||
//some static data for the coin
|
||||
token: [
|
||||
{
|
||||
name: "$PEPE",
|
||||
logo: "/src/assets/img/token/pepe.png",
|
||||
logoMobile: "/src/assets/img/token/pepeMobile.png",
|
||||
logo: "/assets/img/token/pepe.png",
|
||||
logoMobile: "/assets/img/token/pepeMobile.png",
|
||||
vamp: {
|
||||
logo: "/src/assets/img/token/pepevamp.png",
|
||||
logo: "/assets/img/token/pepevamp.png",
|
||||
name: "$PEPE Vamp Token",
|
||||
winner: "/assets/img/token/pepewinner.png",
|
||||
winner2: "/assets/img/token/pepewinnerborder.png",
|
||||
},
|
||||
backgroundColor: "#4b8501",
|
||||
abi: Meme1Json.abi,
|
||||
contractAddress: Meme1Json.contractAddress,
|
||||
addSteps: [
|
||||
{
|
||||
amount: 10000000000000000000000000n,
|
||||
name: "10m",
|
||||
},
|
||||
{
|
||||
amount: 100000000000000000000000000n,
|
||||
name: "100m",
|
||||
},
|
||||
{
|
||||
amount: 1000000000000000000000000000n,
|
||||
name: "1b",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "$SHIB",
|
||||
logo: "/src/assets/img/token/shib.png",
|
||||
logoMobile: "/src/assets/img/token/shibMobile.png",
|
||||
logo: "/assets/img/token/shib.png",
|
||||
logoMobile: "/assets/img/token/shibMobile.png",
|
||||
vamp: {
|
||||
logo: "/src/assets/img/token/shibvamp.png",
|
||||
logo: "/assets/img/token/shibvamp.png",
|
||||
name: "$SHIBA Vamp Token",
|
||||
winner: "/assets/img/token/shibwinner.png",
|
||||
winner2: "/assets/img/token/shibwinnerborder.png",
|
||||
},
|
||||
abi: Meme2Json.abi,
|
||||
contractAddress: Meme2Json.contractAddress,
|
||||
addSteps: [
|
||||
{
|
||||
amount: 1000000000000000000000000n,
|
||||
name: "10m",
|
||||
},
|
||||
{
|
||||
amount: 10000000000000000000000000n,
|
||||
name: "100m",
|
||||
},
|
||||
{
|
||||
amount: 100000000000000000000000000n,
|
||||
name: "1b",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "$ELON",
|
||||
logo: "/assets/img/token/elon.png",
|
||||
logoMobile: "/assets/img/token/elonMobile.png",
|
||||
vamp: {
|
||||
logo: "/assets/img/token/elonvamp.png",
|
||||
name: "$ELON Vamp Token",
|
||||
winner: "/assets/img/token/elonwinner.png",
|
||||
winner2: "/assets/img/token/elonwinnerborder.png",
|
||||
},
|
||||
abi: Meme3Json.abi,
|
||||
contractAddress: Meme3Json.contractAddress,
|
||||
addSteps: [
|
||||
{
|
||||
amount: 10000000000000000000000000n,
|
||||
name: "10m",
|
||||
},
|
||||
{
|
||||
amount: 100000000000000000000000000n,
|
||||
name: "100m",
|
||||
},
|
||||
{
|
||||
amount: 1000000000000000000000000000n,
|
||||
name: "1b",
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// name: "$ELON",
|
||||
// logo: "/src/assets/img/token/elon.png",
|
||||
// logoMobile: "/src/assets/img/token/elonMobile.png",
|
||||
// name: "$BITCOIN",
|
||||
// logo: "/assets/img/token/bitcoin.png",
|
||||
// logoMobile: "/assets/img/token/bitcoin.png",
|
||||
// vamp: {
|
||||
// logo: "/src/assets/img/token/shibvamp.png",
|
||||
// logo: "/assets/img/token/bitcoin.png",
|
||||
// name: "$ELON Vamp Token",
|
||||
// winner: "/assets/img/token/bitcoinwinner.png"
|
||||
// winner2: "/assets/img/token/bitcoinwinnerborder.png"
|
||||
// },
|
||||
// abi: Meme4Json.abi,
|
||||
// contractAddress: Meme4Json.contractAddress,
|
||||
// },
|
||||
// {
|
||||
// name: "$BAD",
|
||||
// logo: "/assets/img/token/bad.png",
|
||||
// logoMobile: "/assets/img/token/bad.png",
|
||||
// vamp: {
|
||||
// logo: "/assets/img/token/bad.png",
|
||||
// name: "$ELON Vamp Token",
|
||||
// },
|
||||
// abi: null,
|
||||
// contractAddress: null,
|
||||
// abi: Meme5Json.abi,
|
||||
// contractAddress: Meme5Json.contractAddress,
|
||||
// },
|
||||
{
|
||||
name: "$BLOOD",
|
||||
abi: BloodlineJson.abi,
|
||||
contractAddress: BloodlineJson.contractAddress,
|
||||
logo: "/assets/img/token/bloodline.png",
|
||||
},
|
||||
],
|
||||
activeToken: {
|
||||
address: null,
|
||||
@@ -51,101 +134,82 @@ export const useTokenStore = defineStore("token", {
|
||||
balance: null,
|
||||
contract: null,
|
||||
allowance: null,
|
||||
rewards: null,
|
||||
},
|
||||
loading: false,
|
||||
memeToken: {
|
||||
config: {
|
||||
abi: MemeToken.abi,
|
||||
contractAddress: MemeToken.contractAddress
|
||||
}
|
||||
},
|
||||
memeBurner: {
|
||||
config: MemeBurnerJson,
|
||||
contract: null,
|
||||
},
|
||||
}),
|
||||
getters: {},
|
||||
getters: {
|
||||
memeToken: (state) => state.token.find((obj) => obj.contractAddress === BloodlineJson.contractAddress),
|
||||
sacrificeToken: (state) => state.token.filter((obj) => obj.contractAddress !== BloodlineJson.contractAddress),
|
||||
},
|
||||
actions: {
|
||||
async changeActiveToken(token) {
|
||||
this.activeToken = token;
|
||||
const web3 = new Web3(window.ethereum);
|
||||
this.contract = new web3.eth.Contract(token.abi, token.contractAddress);
|
||||
const walletStore = useWalletStore();
|
||||
if (walletStore.connected) {
|
||||
this.activeToken.balance = await walletStore.getTokenBalance(token);
|
||||
this.activeToken.allowance = await this.allowance();
|
||||
getToken(address) {
|
||||
console.log("address", address);
|
||||
const token = this.token.find((obj) => obj.contractAddress === address);
|
||||
return token;
|
||||
},
|
||||
async initV2() {
|
||||
console.log("-----------init token-------------");
|
||||
try {
|
||||
const walletStore = useWalletStoreV2();
|
||||
for (let index = 0; index < this.token.length; index++) {
|
||||
const contracts = [];
|
||||
const token = this.token[index];
|
||||
token.contract = getContract({
|
||||
address: token.contractAddress,
|
||||
abi: token.abi,
|
||||
walletClient: walletStore.walletClient || walletStore.publicClient,
|
||||
});
|
||||
|
||||
contracts.push({ ...token.contract, functionName: "decimals" });
|
||||
// contracts.push({ ...token.contract, functionName: "name" });
|
||||
contracts.push({ ...token.contract, functionName: "symbol" });
|
||||
contracts.push({ ...token.contract, functionName: "totalSupply" });
|
||||
const data = await multicall({
|
||||
contracts,
|
||||
});
|
||||
token.decimals = BigInt(data[0].result);
|
||||
// token.name = data[1].result;
|
||||
token.symbol = data[1].result;
|
||||
token.totalSupply = data[2].result;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("initV2", error);
|
||||
}
|
||||
},
|
||||
async allowance() {
|
||||
const walletStore = useWalletStore();
|
||||
console.log("walletStore.address", walletStore.address);
|
||||
const allowance = await this.contract.methods
|
||||
.allowance(walletStore.address, MemeBurnerJson.contractAddress)
|
||||
.call();
|
||||
console.log("allowance");
|
||||
const walletStore = useWalletStoreV2();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var allowance = await this.activeToken.contract.read.allowance([
|
||||
walletStore.address,
|
||||
memeBurnerStore.config.contractAddress,
|
||||
]);
|
||||
|
||||
console.log("allowance", allowance);
|
||||
var decimals = await this.contract.methods.decimals().call();
|
||||
console.log("decimals", decimals);
|
||||
return allowance;
|
||||
},
|
||||
async approveToken(amount) {
|
||||
try {
|
||||
console.log("amount", amount);
|
||||
this.loading = true;
|
||||
const walletStore = useWalletStore();
|
||||
var approve = await this.contract.methods
|
||||
.approve(this.memeBurner.config.contractAddress, amount)
|
||||
.send({ from: walletStore.address });
|
||||
//todo parameter value übergeben in eth web3.utils.toHex(web3.utils.toWei(amount, 'ether'))
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var approveHash = await this.activeToken.contract.write.approve([
|
||||
memeBurnerStore.config.contractAddress,
|
||||
amount,
|
||||
]);
|
||||
console.log("approveHash", approveHash);
|
||||
|
||||
// .send({ from: walletStore.address, value: 0.5 });
|
||||
console.log("approve", approve);
|
||||
this.activeToken.allowance = await this.allowance();
|
||||
return approve;
|
||||
return approveHash;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
async sacrificeToken(amount) {
|
||||
try {
|
||||
console.log("amount", amount);
|
||||
if (!amount || amount == 0) {
|
||||
//todo error
|
||||
console.error("amount is 0 or null or undefined");
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
console.log("this.activeToken.", this.activeToken.contractAddress);
|
||||
const walletStore = useWalletStore();
|
||||
console.log("walletStore.address", walletStore.address);
|
||||
var reward = await this.memeBurner.contract.methods
|
||||
.sacrificeMeme(this.activeToken.contractAddress, amount)
|
||||
.send({ from: walletStore.address });
|
||||
console.log("reward", reward);
|
||||
this.activeToken.allowance = await this.allowance();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
async getRewardsFor(amount) {
|
||||
const contractsStore = useContractStore();
|
||||
var rewards = await contractsStore.list.memeBurnerPublic.methods
|
||||
.getRewardFor(this.activeToken.contractAddress, amount)
|
||||
.call();
|
||||
return rewards;
|
||||
},
|
||||
getTokenContract(token) {
|
||||
console.log("token", token);
|
||||
const contractAddress = token.contractAddress;
|
||||
console.log("contractAddress", contractAddress);
|
||||
const activeToken = this.token.find((obj) => obj.contractAddress === contractAddress);
|
||||
console.log("activeToken", activeToken);
|
||||
const web3 = new Web3(window.ethereum);
|
||||
const contract = new web3.eth.Contract(activeToken.abi, contractAddress);
|
||||
return contract;
|
||||
async nonces(userAddress) {
|
||||
return this.BloodlineJson.contract.read.nonces([userAddress]);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import QuoterJson from "@/assets/contracts/Quoter.json";
|
||||
import UniswapPoolJson from "@/assets/contracts/UniswapPool.json";
|
||||
import BloodlineJson from "@/assets/contracts/Bloodline.json";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
|
||||
import { getContract, multicall } from "@wagmi/core";
|
||||
|
||||
export const useUniswapStore = defineStore("uniswap", {
|
||||
state: () => ({
|
||||
quoateV3Contract: {},
|
||||
quoateV2Contract: {},
|
||||
uniswapPoolContract: {},
|
||||
poolData: {
|
||||
token0: null,
|
||||
token1: null,
|
||||
fee: null,
|
||||
},
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
init() {
|
||||
console.log("init uniswap");
|
||||
const walletStore = useWalletStoreV2();
|
||||
|
||||
this.quoateV3Contract = getContract({
|
||||
address: QuoterJson.contractAddress,
|
||||
abi: QuoterJson.abi,
|
||||
walletClient: walletStore.walletClient || walletStore.publicClient,
|
||||
});
|
||||
|
||||
this.uniswapPoolContract = getContract({
|
||||
address: UniswapPoolJson.contractAddress,
|
||||
abi: UniswapPoolJson.abi,
|
||||
walletClient: walletStore.walletClient || walletStore.publicClient,
|
||||
});
|
||||
|
||||
this.getPoolData();
|
||||
},
|
||||
|
||||
async quoteExactInputSingle(amount, ethBase) {
|
||||
try {
|
||||
console.log("quoteExactInputSingle");
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const tokenStore = useTokenStore();
|
||||
|
||||
const tokenOut = tokenStore.memeToken.contractAddress;
|
||||
// tokenIn - WETH
|
||||
const tokenIn = BigInt(this.poolData.token0) == BigInt(tokenOut) ? this.poolData.token1 : this.poolData.token0;
|
||||
console.log("quoteExactInputSingle-parameter", {
|
||||
tokenIn: tokenIn, // WETH
|
||||
tokenOut: tokenOut, // BLOOD
|
||||
fee: this.poolData.fee,
|
||||
amountEthBase: ethBase,
|
||||
pricelimit: 0, //sqrtPriceLimitX96
|
||||
});
|
||||
|
||||
const quotedAmountOut = await this.quoateV3Contract.read.quoteExactInputSingle([
|
||||
tokenIn, //weth
|
||||
tokenOut, //bloodline
|
||||
this.poolData.fee,
|
||||
ethBase,
|
||||
0, //sqrtPriceLimitX96
|
||||
]);
|
||||
console.log("quotedAmountOut", quotedAmountOut);
|
||||
return {result: true, amount: quotedAmountOut};
|
||||
} catch (error) {
|
||||
|
||||
return { result: false, amount: null };
|
||||
}
|
||||
},
|
||||
async getPoolData() {
|
||||
console.log("getPoolData");
|
||||
const contracts = [];
|
||||
contracts.push(
|
||||
{
|
||||
...this.uniswapPoolContract,
|
||||
functionName: "token0",
|
||||
},
|
||||
{
|
||||
...this.uniswapPoolContract,
|
||||
functionName: "token1",
|
||||
},
|
||||
{
|
||||
...this.uniswapPoolContract,
|
||||
functionName: "fee",
|
||||
}
|
||||
);
|
||||
const data = await multicall({
|
||||
contracts,
|
||||
});
|
||||
this.poolData.token0 = data[0].result;
|
||||
this.poolData.token1 = data[1].result;
|
||||
this.poolData.fee = data[2].result;
|
||||
console.log("this.poolData", this.poolData);
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,87 +0,0 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { useTokenStore } from "./tokens";
|
||||
import Web3 from "web3";
|
||||
export const useWalletStore = defineStore("wallet", {
|
||||
state: () => ({
|
||||
count: 0,
|
||||
alchemy: null,
|
||||
connected: false,
|
||||
address: null,
|
||||
web3: null
|
||||
}),
|
||||
getters: {
|
||||
},
|
||||
actions: {
|
||||
increment() {
|
||||
this.count++;
|
||||
},
|
||||
connectWallet() {
|
||||
console.log("window.ethereum", window.ethereum);
|
||||
// if (window.ethereum) {
|
||||
window.ethereum
|
||||
.request({ method: "eth_requestAccounts" })
|
||||
.then((data) => {
|
||||
console.log("data", data);
|
||||
this.isConnected();
|
||||
// this.address = data[0];
|
||||
// this.connected = true;
|
||||
// const tokenStore = useTokenStore();
|
||||
// if (tokenStore.activeToken.address) {
|
||||
// //Token selected but not refreshed
|
||||
// this.getTokenBalance(tokenStore.activeToken.address).then(
|
||||
// (data) => (tokenStore.activeToken.balance = data)
|
||||
// );
|
||||
// }
|
||||
// console.log("permissions", permissions);
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.code === 4001) {
|
||||
// EIP-1193 userRejectedRequest error
|
||||
console.log("Please connect to MetaMask.");
|
||||
} else {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
// }
|
||||
},
|
||||
async getTokenBalance(token) {
|
||||
const tokenStore = useTokenStore();
|
||||
const contract = tokenStore.getTokenContract(token);
|
||||
const result = await contract.methods.balanceOf(this.address).call();
|
||||
return result;
|
||||
},
|
||||
async isConnected() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const accounts = await window.ethereum.request({ method: "eth_accounts" });
|
||||
if (accounts.length) {
|
||||
this.connected = true;
|
||||
this.address = accounts[0];
|
||||
console.log(`You're connected to: ${accounts[0]}`);
|
||||
const web3 = new Web3(window.ethereum);
|
||||
const tokenStore = useTokenStore();
|
||||
console.log("tokenStore.activeToken", tokenStore.activeToken);
|
||||
if (tokenStore.activeToken.contractAddress) {
|
||||
tokenStore.activeToken.balance = await this.getTokenBalance(
|
||||
tokenStore.activeToken
|
||||
);
|
||||
tokenStore.activeToken.allowance = await tokenStore.allowance();
|
||||
}
|
||||
tokenStore.memeBurner.contract = new web3.eth.Contract(
|
||||
tokenStore.memeBurner.config.abi,
|
||||
tokenStore.memeBurner.config.contractAddress
|
||||
);
|
||||
} else {
|
||||
console.log("Metamask is not connected");
|
||||
this.connected = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
persist: true,
|
||||
});
|
||||