Merge pull request #5 from liftlearning/search-tokens
Search Tokens component
This commit is contained in:
16 files changed
+739
-92
No files matched your search
+2
-2
@@ -8,8 +8,8 @@
|
||||
"serve": "vue-cli-service serve",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --noEmit",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore --fix"
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
|
||||
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
||||
},
|
||||
"dependencies": {
|
||||
"@headlessui/vue": "^1.7.3",
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="10" height="16" viewBox="0 0 10 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 1.5C4 0.947715 4.44772 0.5 5 0.5C5.55229 0.5 6 0.947715 6 1.5V12.0858L8.29289 9.79289C8.68342 9.40237 9.31658 9.40237 9.70711 9.79289C10.0976 10.1834 10.0976 10.8166 9.70711 11.2071L5.70711 15.2071C5.31658 15.5976 4.68342 15.5976 4.29289 15.2071L0.292893 11.2071C-0.0976311 10.8166 -0.0976311 10.1834 0.292893 9.79289C0.683417 9.40237 1.31658 9.40237 1.70711 9.79289L4 12.0858V1.5Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 553 B |
@@ -0,0 +1,18 @@
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_257_714)">
|
||||
<path d="M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z" fill="#170636"/>
|
||||
<path d="M24.269 9.72809L20.1404 13.8568L24.269 17.9854L28.3977 13.8568L24.269 9.72809Z" fill="#14B23D"/>
|
||||
<path d="M7.76489 9.68823L3.63623 13.8169L7.76489 17.9456L11.8936 13.8169L7.76489 9.68823Z" fill="#FFC100"/>
|
||||
<path d="M16.0261 17.9628L11.8975 22.0915L16.0261 26.2202L20.1548 22.0915L16.0261 17.9628Z" fill="#14B23D"/>
|
||||
<path d="M7.76196 9.69141L16.0274 17.9568H24.2549L15.9895 9.69141H7.76196Z" fill="url(#paint0_linear_257_714)"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_257_714" x1="9.81965" y1="7.64005" x2="13.4843" y2="22.2149" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFDC00"/>
|
||||
<stop offset="1" stop-color="#07E58A"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_257_714">
|
||||
<rect width="32" height="32" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM14.7232 9.76501C15.0157 9.6188 15.3446 9.6188 15.6005 9.76501L18.5614 11.483C18.8538 11.6658 19 11.9582 19 12.2507V15.7232C19 16.0522 18.8172 16.3446 18.5614 16.4909L15.6005 18.2089C15.3081 18.3551 14.9791 18.3551 14.7232 18.2089L11.7624 16.4909C11.47 16.3081 11.3238 16.0157 11.3238 15.7232V14.517L12.7128 13.7128V14.8825C12.7128 15.2115 12.8956 15.5039 13.1514 15.6501L14.7232 16.564C15.0157 16.7102 15.3446 16.7102 15.6005 16.564L17.1358 15.6501C17.4282 15.4674 17.5744 15.1749 17.5744 14.8825V13.0548C17.5744 12.7258 17.3916 12.4334 17.1358 12.2872L15.564 11.3734C15.2715 11.2272 14.9426 11.2272 14.6867 11.3734L12.6762 12.5431L11.2872 13.3473L9.27676 14.517C8.98433 14.6632 8.65535 14.6632 8.39948 14.517L5.43864 12.799C5.14621 12.6162 5 12.3238 5 12.0313V8.5953C5 8.30287 5.14621 8.01044 5.43864 7.86423L8.43603 6.10966C8.72846 5.96345 9.05744 5.96345 9.31332 6.10966L12.2376 7.82768C12.53 8.01044 12.6762 8.30287 12.6762 8.5953V9.83812L11.2872 10.6423V9.43603C11.2872 9.10705 11.1044 8.81462 10.8486 8.66841L9.27676 7.71802C8.98433 7.5718 8.65535 7.5718 8.39948 7.71802L6.82768 8.63185C6.53525 8.81462 6.38903 9.10705 6.38903 9.39948V11.2272C6.38903 11.5561 6.5718 11.8486 6.82768 11.9948L8.39948 12.9452C8.69191 13.0914 9.02089 13.0914 9.27676 12.9452L11.2872 11.7389L12.6762 10.9713L14.7232 9.76501Z" fill="#6366F1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
text: String,
|
||||
isDisabled: Boolean,
|
||||
});
|
||||
|
||||
const emit = defineEmits(["buttonClicked"]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
type="button"
|
||||
class="button"
|
||||
@click="emit('buttonClicked')"
|
||||
v-bind:class="{ 'opacity-70': props.isDisabled }"
|
||||
:disabled="props.isDisabled ? props.isDisabled : false"
|
||||
>
|
||||
{{ props.text }}
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.button {
|
||||
@apply rounded-lg w-full text-base font-semibold text-gray-900 py-4 bg-amber-400;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,193 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import CustomButton from "../components/CustomButton.vue";
|
||||
import { debounce } from "@/utils/debounce";
|
||||
import { useEtherStore } from "@/store/ether";
|
||||
import { storeToRefs } from "pinia";
|
||||
import blockchain from "../utils/blockchain";
|
||||
|
||||
const etherStore = useEtherStore();
|
||||
|
||||
const { walletAddress, depositList } = storeToRefs(etherStore);
|
||||
|
||||
const tokenValue = ref(0);
|
||||
const enableSelectButton = ref(false);
|
||||
const hasLiquidity = ref(true);
|
||||
const validDecimals = ref(true);
|
||||
const selectedDeposit = ref();
|
||||
|
||||
const connectAccount = async () => {
|
||||
await blockchain.connectProvider();
|
||||
verifyLiquidity();
|
||||
};
|
||||
|
||||
const handleInputEvent = (event: any) => {
|
||||
const { value } = event.target;
|
||||
|
||||
tokenValue.value = Number(value);
|
||||
|
||||
if (decimalCount(tokenValue.value) > 2) {
|
||||
validDecimals.value = false;
|
||||
enableSelectButton.value = false;
|
||||
return;
|
||||
}
|
||||
validDecimals.value = true;
|
||||
|
||||
verifyLiquidity();
|
||||
};
|
||||
|
||||
const decimalCount = (num: Number) => {
|
||||
const numStr = String(num);
|
||||
if (numStr.includes(".")) {
|
||||
return numStr.split(".")[1].length;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
const verifyLiquidity = () => {
|
||||
enableSelectButton.value = false;
|
||||
selectedDeposit.value = null;
|
||||
|
||||
if (!walletAddress.value || tokenValue.value == 0) return;
|
||||
|
||||
depositList.value.forEach((deposit) => {
|
||||
const p2pixTokenValue = blockchain.verifyDepositAmmount(
|
||||
deposit.args.amount
|
||||
);
|
||||
|
||||
if (
|
||||
tokenValue.value!! <= Number(p2pixTokenValue) &&
|
||||
tokenValue.value!! != 0
|
||||
) {
|
||||
enableSelectButton.value = true;
|
||||
hasLiquidity.value = true;
|
||||
selectedDeposit.value = deposit;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (!enableSelectButton.value) {
|
||||
hasLiquidity.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const emit = defineEmits(["tokenBuy"]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="text-container">
|
||||
<span class="text font-extrabold text-5xl max-w-[29rem]"
|
||||
>Adquira cripto com apenas um Pix</span
|
||||
>
|
||||
<span class="text font-medium text-base max-w-[28rem]"
|
||||
>Digite um valor, confira a oferta, conecte sua carteira e receba os
|
||||
tokens após realizar o Pix</span
|
||||
>
|
||||
</div>
|
||||
<div class="blur-container">
|
||||
<div
|
||||
class="flex flex-col w-full bg-white px-10 py-5 rounded-lg border-y-10"
|
||||
>
|
||||
<div class="flex justify-between w-full items-center">
|
||||
<input
|
||||
type="number"
|
||||
class="border-none outline-none text-lg text-gray-900 w-fit"
|
||||
v-bind:class="{
|
||||
'font-semibold': tokenValue != undefined,
|
||||
'text-xl': tokenValue != undefined,
|
||||
}"
|
||||
@input="debounce(handleInputEvent, 500)($event)"
|
||||
placeholder="0 "
|
||||
step=".01"
|
||||
/>
|
||||
<div
|
||||
class="flex flex-row p-2 px-3 bg-gray-300 rounded-3xl min-w-fit gap-1"
|
||||
>
|
||||
<img alt="Token image" class="w-fit" src="@/assets/brz.svg" />
|
||||
<span class="text-gray-900 text-lg w-fit" id="brz">BRZ</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="custom-divide py-2"></div>
|
||||
<div class="flex justify-between pt-2" v-if="hasLiquidity">
|
||||
<p class="text-gray-500 font-normal text-sm w-auto">
|
||||
~ R$ {{ tokenValue.toFixed(2) }}
|
||||
</p>
|
||||
<div class="flex gap-2">
|
||||
<img
|
||||
alt="Polygon image"
|
||||
src="@/assets/polygon.svg"
|
||||
width="24"
|
||||
height="24"
|
||||
/>
|
||||
<img
|
||||
alt="Ethereum image"
|
||||
src="@/assets/ethereum.svg"
|
||||
width="24"
|
||||
height="24"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex pt-2 justify-center" v-if="!validDecimals">
|
||||
<span class="text-red-500 font-normal text-sm"
|
||||
>Por favor utilize no máximo 2 casas decimais</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex pt-2 justify-center" v-else-if="!hasLiquidity">
|
||||
<span class="text-red-500 font-normal text-sm"
|
||||
>Atualmente não há liquidez nas redes para sua demanda</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<CustomButton
|
||||
v-if="!walletAddress"
|
||||
:text="'Conectar carteira'"
|
||||
@buttonClicked="connectAccount()"
|
||||
/>
|
||||
<CustomButton
|
||||
v-if="walletAddress"
|
||||
:text="'Confirmar compra'"
|
||||
:is-disabled="!enableSelectButton"
|
||||
@buttonClicked="emit('tokenBuy', { selectedDeposit, tokenValue })"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.custom-divide {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #d1d5db;
|
||||
}
|
||||
.bottom-position {
|
||||
top: -20px;
|
||||
right: 50%;
|
||||
transform: translateX(50%);
|
||||
}
|
||||
|
||||
.page {
|
||||
@apply flex flex-col items-center justify-center w-full mt-16;
|
||||
}
|
||||
|
||||
.text-container {
|
||||
@apply flex flex-col items-center justify-center gap-4;
|
||||
}
|
||||
|
||||
.text {
|
||||
@apply text-gray-800 text-center;
|
||||
}
|
||||
|
||||
.blur-container {
|
||||
@apply flex flex-col justify-center items-center px-8 py-6 gap-2 rounded-lg shadow-md shadow-gray-600 backdrop-blur-md mt-10;
|
||||
}
|
||||
|
||||
input[type="number"] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
</style>
|
||||
@@ -37,6 +37,7 @@ const formatWalletBalance = (): string => {
|
||||
src="@/assets/logo.svg"
|
||||
width="75"
|
||||
height="75"
|
||||
@load="connectMetaMask()"
|
||||
/>
|
||||
<div class="flex gap-4 items-center">
|
||||
<button type="button" class="default-button">Quero vender</button>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
import HomeView from "../views/HomeView.vue";
|
||||
import QrCodeFormVue from "../views/QrCodeForm.vue";
|
||||
import MockView from "../views/MockView.vue";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -15,6 +16,11 @@ const router = createRouter({
|
||||
name: "pix",
|
||||
component: QrCodeFormVue,
|
||||
},
|
||||
{
|
||||
path: "/mock",
|
||||
name: "mock",
|
||||
component: MockView,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ export const useEtherStore = defineStore("ether", {
|
||||
state: () => ({
|
||||
walletAddress: "",
|
||||
balance: "",
|
||||
depositList: [{}],
|
||||
}),
|
||||
actions: {
|
||||
setWalletAddress(walletAddress: string) {
|
||||
@@ -12,5 +13,8 @@ export const useEtherStore = defineStore("ether", {
|
||||
setBalance(balance: string) {
|
||||
this.balance = balance;
|
||||
},
|
||||
setDepositList(depositList: any[]) {
|
||||
this.depositList = depositList;
|
||||
},
|
||||
},
|
||||
});
|
||||
+95
-11
@@ -1,11 +1,13 @@
|
||||
import { useEtherStore } from "@/store/ether";
|
||||
import { ethers } from "ethers";
|
||||
import { BigNumber, ethers } from "ethers";
|
||||
|
||||
// smart contract imports
|
||||
import mockToken from "./smart_contract_files/MockToken.json";
|
||||
//import p2pix from "./smart_contract_files/P2PIX.json";
|
||||
import p2pix from "./smart_contract_files/P2PIX.json";
|
||||
import addresses from "./smart_contract_files/localhost.json";
|
||||
|
||||
import { wallets } from "./smart_contract_files/wallets.json";
|
||||
|
||||
const updateWalletStatus = async (walletAddress: string) => {
|
||||
const etherStore = useEtherStore();
|
||||
const provider = getProvider();
|
||||
@@ -37,15 +39,20 @@ const connectProvider = async () => {
|
||||
etherStore.setWalletAddress(walletAddress[0]);
|
||||
etherStore.setBalance(String(balance));
|
||||
|
||||
const p2pContract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
|
||||
|
||||
const filter = p2pContract.filters.DepositAdded(null);
|
||||
const events = await p2pContract.queryFilter(filter);
|
||||
|
||||
console.log(events);
|
||||
etherStore.setDepositList(events);
|
||||
|
||||
connection.on("accountsChanged", (accounts: string[]) => {
|
||||
updateWalletStatus(accounts[0]);
|
||||
});
|
||||
};
|
||||
|
||||
const makeTransaction = async (
|
||||
receiverAccountAddress = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
||||
ammount = "100.0"
|
||||
) => {
|
||||
const splitTokens = async () => {
|
||||
const etherStore = useEtherStore();
|
||||
const provider = getProvider();
|
||||
if (!provider) return;
|
||||
@@ -53,13 +60,78 @@ const makeTransaction = async (
|
||||
const signer = provider.getSigner();
|
||||
const contract = new ethers.Contract(addresses.token, mockToken.abi, signer);
|
||||
|
||||
const tx = await contract.transfer(
|
||||
receiverAccountAddress,
|
||||
ethers.utils.parseEther(ammount)
|
||||
for (let i = 0; i < wallets.length; i++) {
|
||||
const tx = await contract.transfer(
|
||||
wallets[i],
|
||||
ethers.utils.parseEther("4000000.0")
|
||||
);
|
||||
await tx.wait();
|
||||
updateWalletStatus(etherStore.walletAddress);
|
||||
}
|
||||
};
|
||||
|
||||
const mockDeposit = async (tokenQty = "1000.0", pixKey = "00011122233") => {
|
||||
const etherStore = useEtherStore();
|
||||
const provider = getProvider();
|
||||
if (!provider) return;
|
||||
|
||||
const signer = provider.getSigner();
|
||||
|
||||
const tokenContract = new ethers.Contract(
|
||||
addresses.token,
|
||||
mockToken.abi,
|
||||
signer
|
||||
);
|
||||
await tx.wait();
|
||||
const p2pContract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
|
||||
|
||||
// first get the approval
|
||||
const apprv = await tokenContract.approve(
|
||||
addresses.p2pix,
|
||||
ethers.utils.parseEther(tokenQty)
|
||||
);
|
||||
await apprv.wait();
|
||||
|
||||
// deposit
|
||||
const deposit = await p2pContract.deposit(
|
||||
addresses.token,
|
||||
ethers.utils.parseEther(tokenQty),
|
||||
pixKey
|
||||
);
|
||||
await deposit.wait();
|
||||
|
||||
updateWalletStatus(etherStore.walletAddress);
|
||||
|
||||
const filter = p2pContract.filters.DepositAdded(null);
|
||||
const events = await p2pContract.queryFilter(filter);
|
||||
|
||||
console.log(events);
|
||||
|
||||
etherStore.setDepositList(events);
|
||||
};
|
||||
|
||||
const countDeposit = async () => {
|
||||
const provider = getProvider();
|
||||
if (!provider) return;
|
||||
|
||||
const signer = provider.getSigner();
|
||||
const contract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
|
||||
|
||||
const count = await contract.depositCount();
|
||||
|
||||
console.log(Number(count));
|
||||
};
|
||||
|
||||
const mapDeposits = async (depositId: BigNumber) => {
|
||||
const provider = getProvider();
|
||||
if (!provider) return;
|
||||
|
||||
const signer = provider.getSigner();
|
||||
const contract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
|
||||
|
||||
const deposit = await contract.mapDeposits(depositId);
|
||||
|
||||
console.log(deposit);
|
||||
return deposit;
|
||||
};
|
||||
|
||||
const formatEther = (balance: string) => {
|
||||
@@ -67,6 +139,10 @@ const formatEther = (balance: string) => {
|
||||
return formatted;
|
||||
};
|
||||
|
||||
const verifyDepositAmmount = (ammountBigNumber: BigNumber): string => {
|
||||
return ethers.utils.formatEther(ammountBigNumber);
|
||||
};
|
||||
|
||||
const getProvider = (): ethers.providers.Web3Provider | null => {
|
||||
const window_ = window as any;
|
||||
const connection = window_.ethereum;
|
||||
@@ -76,4 +152,12 @@ const getProvider = (): ethers.providers.Web3Provider | null => {
|
||||
return new ethers.providers.Web3Provider(connection);
|
||||
};
|
||||
|
||||
export default { connectProvider, formatEther, makeTransaction };
|
||||
export default {
|
||||
connectProvider,
|
||||
formatEther,
|
||||
splitTokens,
|
||||
mockDeposit,
|
||||
countDeposit,
|
||||
mapDeposits,
|
||||
verifyDepositAmmount,
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
export const debounce = (func: any, delay: number) => {
|
||||
let timer: any = null;
|
||||
return function (this: unknown, ...args: any) {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
func.apply(this, args);
|
||||
}, delay);
|
||||
};
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "MockToken",
|
||||
"sourceName": "contracts/mockToken.sol",
|
||||
"sourceName": "contracts/lib/mock/mockToken.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -32,7 +32,7 @@
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
@@ -57,23 +57,36 @@
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"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": "owner",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
@@ -116,7 +129,7 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
@@ -144,54 +157,6 @@
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "subtractedValue",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "decreaseAllowance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "addedValue",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "increaseAllowance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
@@ -205,6 +170,68 @@
|
||||
"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",
|
||||
@@ -285,8 +312,8 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60806040523480156200001157600080fd5b5060405162000b8d38038062000b8d83398101604081905262000034916200021d565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b9084015281519192916200007f9160039162000177565b5080516200009590600490602084019062000177565b505050620000aa3382620000b160201b60201c565b506200029b565b6001600160a01b0382166200010c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b806002600082825462000120919062000237565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b82805462000185906200025e565b90600052602060002090601f016020900481019282620001a95760008555620001f4565b82601f10620001c457805160ff1916838001178555620001f4565b82800160010185558215620001f4579182015b82811115620001f4578251825591602001919060010190620001d7565b506200020292915062000206565b5090565b5b8082111562000202576000815560010162000207565b6000602082840312156200023057600080fd5b5051919050565b600082198211156200025957634e487b7160e01b600052601160045260246000fd5b500190565b600181811c908216806200027357607f821691505b602082108114156200029557634e487b7160e01b600052602260045260246000fd5b50919050565b6108e280620002ab6000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80633950935111610081578063a457c2d71161005b578063a457c2d714610187578063a9059cbb1461019a578063dd62ed3e146101ad57600080fd5b8063395093511461014357806370a082311461015657806395d89b411461017f57600080fd5b806318160ddd116100b257806318160ddd1461010f57806323b872dd14610121578063313ce5671461013457600080fd5b806306fdde03146100ce578063095ea7b3146100ec575b600080fd5b6100d66101e6565b6040516100e39190610748565b60405180910390f35b6100ff6100fa3660046107b9565b610278565b60405190151581526020016100e3565b6002545b6040519081526020016100e3565b6100ff61012f3660046107e3565b610290565b604051601281526020016100e3565b6100ff6101513660046107b9565b6102b4565b61011361016436600461081f565b6001600160a01b031660009081526020819052604090205490565b6100d66102f3565b6100ff6101953660046107b9565b610302565b6100ff6101a83660046107b9565b6103b1565b6101136101bb366004610841565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101f590610874565b80601f016020809104026020016040519081016040528092919081815260200182805461022190610874565b801561026e5780601f106102435761010080835404028352916020019161026e565b820191906000526020600020905b81548152906001019060200180831161025157829003601f168201915b5050505050905090565b6000336102868185856103bf565b5060019392505050565b60003361029e8582856104e3565b6102a9858585610575565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061028690829086906102ee9087906108af565b6103bf565b6060600480546101f590610874565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103a45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102a982868684036103bf565b600033610286818585610575565b6001600160a01b0383166104215760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161039b565b6001600160a01b0382166104825760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161039b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461056f57818110156105625760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161039b565b61056f84848484036103bf565b50505050565b6001600160a01b0383166105f15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161039b565b6001600160a01b0382166106535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161039b565b6001600160a01b038316600090815260208190526040902054818110156106e25760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161039b565b6001600160a01b0384811660008181526020818152604080832087870390559387168083529184902080548701Line truncated
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80633950935111610081578063a457c2d71161005b578063a457c2d714610187578063a9059cbb1461019a578063dd62ed3e146101ad57600080fd5b8063395093511461014357806370a082311461015657806395d89b411461017f57600080fd5b806318160ddd116100b257806318160ddd1461010f57806323b872dd14610121578063313ce5671461013457600080fd5b806306fdde03146100ce578063095ea7b3146100ec575b600080fd5b6100d66101e6565b6040516100e39190610748565b60405180910390f35b6100ff6100fa3660046107b9565b610278565b60405190151581526020016100e3565b6002545b6040519081526020016100e3565b6100ff61012f3660046107e3565b610290565b604051601281526020016100e3565b6100ff6101513660046107b9565b6102b4565b61011361016436600461081f565b6001600160a01b031660009081526020819052604090205490565b6100d66102f3565b6100ff6101953660046107b9565b610302565b6100ff6101a83660046107b9565b6103b1565b6101136101bb366004610841565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101f590610874565b80601f016020809104026020016040519081016040528092919081815260200182805461022190610874565b801561026e5780601f106102435761010080835404028352916020019161026e565b820191906000526020600020905b81548152906001019060200180831161025157829003601f168201915b5050505050905090565b6000336102868185856103bf565b5060019392505050565b60003361029e8582856104e3565b6102a9858585610575565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061028690829086906102ee9087906108af565b6103bf565b6060600480546101f590610874565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103a45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102a982868684036103bf565b600033610286818585610575565b6001600160a01b0383166104215760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161039b565b6001600160a01b0382166104825760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161039b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461056f57818110156105625760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161039b565b61056f84848484036103bf565b50505050565b6001600160a01b0383166105f15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161039b565b6001600160a01b0382166106535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161039b565b6001600160a01b038316600090815260208190526040902054818110156106e25760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161039b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361056f565b600060208083528351808285015260005b8181101561077557858101830151858201604001528201610759565b81811115610787576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146107b457600080fd5b919050565b600080604083850312156107cc57600080fd5b6107d58361079d565b946020939093013593505050565b6000806000606084860312156107f857600080fd5b6108018461079d565b925061080f6020850161079d565b9150604084013590509250925092565b60006020828403121561083157600080fd5b61083a8261079d565b9392505050565b6000806040838503121561085457600080fd5b61085d8361079d565b915061086b6020840161079d565b90509250929050565b600181811c9082168061088857607f821691505b602082108114156108a957634e487b7160e01b600052602260045260246000fd5b50919050565b600082198211156108d057634e487b7160e01b600052601160045260246000fd5b50019056fea164736f6c6343000809000a",
|
||||
"bytecode": "0x60e06040523480156200001157600080fd5b5060405162000e5138038062000e51833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610a86620003cb600039600061044501526000610410015260006101490152610a866000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806370a0823111610081578063a9059cbb1161005b578063a9059cbb146101cd578063d505accf146101e0578063dd62ed3e146101f557600080fd5b806370a08231146101855780637ecebe00146101a557806395d89b41146101c557600080fd5b806323b872dd116100b257806323b872dd14610131578063313ce567146101445780633644e5151461017d57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610220565b6040516100ee91906107de565b60405180910390f35b61010a61010536600461084f565b6102ae565b60405190151581526020016100ee565b61012360025481565b6040519081526020016100ee565b61010a61013f366004610879565b61031a565b61016b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100ee565b61012361040c565b6101236101933660046108b5565b60036020526000908152604090205481565b6101236101b33660046108b5565b60056020526000908152604090205481565b6100e1610467565b61010a6101db36600461084f565b610474565b6101f36101ee3660046108d7565b6104ec565b005b61012361020336600461094a565b600460209081526000928352604080842090915290825290205481565b6000805461022d9061097d565b80601f01602080910402602001604051908101604052809291908181526020018280546102599061097d565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103099086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103765761035183826109b8565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061039e9084906109b8565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103f99087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104425761043d610744565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461022d9061097d565b336000908152600360205260408120805483919083906104959084906109b8565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103099086815260200190565b428410156105415760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161054d61040c565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b61010083015261010282019290925261Line truncated
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806370a0823111610081578063a9059cbb1161005b578063a9059cbb146101cd578063d505accf146101e0578063dd62ed3e146101f557600080fd5b806370a08231146101855780637ecebe00146101a557806395d89b41146101c557600080fd5b806323b872dd116100b257806323b872dd14610131578063313ce567146101445780633644e5151461017d57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610220565b6040516100ee91906107de565b60405180910390f35b61010a61010536600461084f565b6102ae565b60405190151581526020016100ee565b61012360025481565b6040519081526020016100ee565b61010a61013f366004610879565b61031a565b61016b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100ee565b61012361040c565b6101236101933660046108b5565b60036020526000908152604090205481565b6101236101b33660046108b5565b60056020526000908152604090205481565b6100e1610467565b61010a6101db36600461084f565b610474565b6101f36101ee3660046108d7565b6104ec565b005b61012361020336600461094a565b600460209081526000928352604080842090915290825290205481565b6000805461022d9061097d565b80601f01602080910402602001604051908101604052809291908181526020018280546102599061097d565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103099086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103765761035183826109b8565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061039e9084906109b8565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103f99087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104425761043d610744565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461022d9061097d565b336000908152600360205260408120805483919083906104959084906109b8565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103099086815260200190565b428410156105415760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161054d61040c565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610659573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061068f5750876001600160a01b0316816001600160a01b0316145b6106db5760405162461bcd60e51b815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610538565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600060405161077691906109dd565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600060208083528351808285015260005b8181101561080b578581018301518582016040015282016107ef565b8181111561081d576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461084a57600080fd5b919050565b6000806040838503121561086257600080fd5b61086b83610833565b946020939093013593505050565b60008060006060848603121561088e57600080fd5b61089784610833565b92506108a560208501610833565b9150604084013590509250925092565b6000602082840312156108c757600080fd5b6108d082610833565b9392505050565b600080600080600080600060e0888a0312156108f257600080fd5b6108fb88610833565b965061090960208901610833565b95506040880135945060608801359350608088013560ff8116811461092d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561095d57600080fd5b61096683610833565b915061097460208401610833565b90509250929050565b600181811c9082168061099157607f821691505b602082108114156109b257634e487b7160e01b600052602260045260246000fd5b50919050Line truncated
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -16,9 +16,59 @@
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"stateMutability": "payable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AlreadyReleased",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DepositAlreadyExists",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidDeposit",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSigner",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LoopOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotEnoughTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "OnlySeller",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Reentrancy",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TxAlreadyUsed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
@@ -175,7 +225,7 @@
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "previousOwner",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
@@ -185,7 +235,7 @@
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnershipTransferred",
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
@@ -207,6 +257,25 @@
|
||||
"name": "PremiumsWithdrawn",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_addr",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "_castAddrToKey",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_key",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
@@ -268,7 +337,7 @@
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_value",
|
||||
"name": "_val",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
@@ -279,27 +348,27 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "depositID",
|
||||
"name": "_depositID",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "targetAddress",
|
||||
"name": "_targetAddress",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "relayerAddress",
|
||||
"name": "_relayerAddress",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "relayerPremium",
|
||||
"name": "_relayerPremium",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"name": "_amount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
@@ -319,6 +388,94 @@
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "mapDeposits",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "remaining",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "premium",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "pixTarget",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "valid",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "mapLocks",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "depositID",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "relayerPremium",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "expirationBlock",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "targetAddress",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "relayerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
@@ -365,13 +522,6 @@
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "renounceOwnership",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
@@ -380,7 +530,7 @@
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferOwnership",
|
||||
"name": "setOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
@@ -401,9 +551,9 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "validBacenSigners",
|
||||
@@ -443,8 +593,8 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60806040523480156200001157600080fd5b506040516200197238038062001972833981016040819052620000349162000145565b6200003f33620000c2565b600282905560005b81518160ff161015620000b957600160036000848460ff168151811062000072576200007262000225565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000b0816200023b565b91505062000047565b5050506200026a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200014057600080fd5b919050565b600080604083850312156200015957600080fd5b8251602080850151919350906001600160401b03808211156200017b57600080fd5b818601915086601f8301126200019057600080fd5b815181811115620001a557620001a562000112565b8060051b604051601f19603f83011681018181108582111715620001cd57620001cd62000112565b604052918252848201925083810185019189831115620001ec57600080fd5b938501935b828510156200021557620002058562000128565b84529385019392850192620001f1565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8114156200026157634e487b7160e01b600052601160045260246000fd5b60010192915050565b6116f8806200027a6000396000f3fe6080604052600436106100d25760003560e01c806372fada5c1161007f5780639872dbfe116100595780639872dbfe146101f5578063b93bd7d41461020b578063bfe07da61461024b578063f2fde38b1461025e57600080fd5b806372fada5c1461018d5780638da5cb5b146101ad5780638e2749d6146101d557600080fd5b80634e1389ed116100b05780634e1389ed146101435780636193cdfb14610163578063715018a61461017857600080fd5b806303aaf306146100d75780632dfdf0b51461010a5780633631797214610121575b600080fd5b3480156100e357600080fd5b506100f76100f2366004611345565b61027e565b6040519081526020015b60405180910390f35b34801561011657600080fd5b506001546100f79081565b34801561012d57600080fd5b5061014161013c3660046113c7565b610573565b005b34801561014f57600080fd5b5061014161015e366004611413565b610701565b34801561016f57600080fd5b50610141610b7c565b34801561018457600080fd5b50610141610bf0565b34801561019957600080fd5b506101416101a8366004611466565b610c04565b3480156101b957600080fd5b506000546040516001600160a01b039091168152602001610101565b3480156101e157600080fd5b506101416101f036600461147f565b610ce0565b34801561020157600080fd5b506100f760025481565b34801561021757600080fd5b5061023b6102263660046114c1565b60036020526000908152604090205460ff1681565b6040519015158152602001610101565b6100f76102593660046114e3565b610e62565b34801561026a57600080fd5b506101416102793660046114c1565b6110fd565b600061028a8383610ce0565b60008881526004602081905260409091209081015460ff166102f35760405162461bcd60e51b815260206004820181905260248201527f50325049583a204465706f736974206e6f742076616c696420616e796d6f726560448201526064015b60405180910390fd5b848160020154101561036d5760405162461bcd60e51b815260206004820152602c60248201527f50325049583a204e6f7420656e6f75676820746f6b656e2072656d61696e696e60448201527f67206f6e206465706f736974000000000000000000000000000000000000000060648201526084016102ea565b60408051602081018b9052908101869052606089811b6bffffffffffffffffffffffff1916908201526074016040516020818303038152906040528051906020012091504360056000848152602001908152602001600020600501541061043c5760405162461bcd60e51b815260206004820152603360248201527f50325049583a20416e6f74686572206c6f636b20776974682073616d6520494460448201527f206973206e6f742065787069726564207965740000000000000000000000000060648201526084016102ea565b60006040518060c001604052808b81526020018a6001600160a01b03168152602001896001600160a01b03168152602001888152602001878152602001600254436104879190611580565b9052600084815260056020818152604080842085518155918501516001830180546001600160a01b0392831673ffffffffffffffffffffffffffffffffffffffff199182161790915591860151600280850180549290931691909316179055606085015160038301556080850151600483015560a0850151919092015584018054929350889290919061051b908490611598565b9091555050604080518b81526020810188905284916001600160a01b038c16917f2a28b2ae47b0bd4b104e7cd29b1dfa72846af8c4cfdc009da2ae29db68cb67ea910160405180910390a35050979650505050505050565b60008381526004602052604090205483906001600160a01b031633146105f05760405162461bcd60e51b815260206004820152602c60248201527f50325049583a204f6e6c792073656c6c657220636f756c642063616c6c20746860448201526b34b990333ab731ba34b7b71760a11b60648201526084016102ea565b6105fa8383610ce0565b60008481526004602081905260409091209081015460ff16156106205761062085610c04565b60018101548154600283015460405163a9059cbb60e01b81526001600160a01b0392831660048201526024810191909152911690819063a9059cbb90604401602060405180830381600087803b15801561067957600080fd5b505af115801561068d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b191906115af565b506002820180546000909155604080518881526020810183905233917f7719804546c0185709e60c90d164447ff251a5ba29af0216faa921350f6bebf7910160405180910390a250505050505050565b60008581526005602081905260409091209081015443108015610728575060008160040154115b61079a5760405162461bcd60e51b81526020600482015260Line truncated
|
||||
"deployedBytecode": "0x6080604052600436106100d25760003560e01c806372fada5c1161007f5780639872dbfe116100595780639872dbfe146101f5578063b93bd7d41461020b578063bfe07da61461024b578063f2fde38b1461025e57600080fd5b806372fada5c1461018d5780638da5cb5b146101ad5780638e2749d6146101d557600080fd5b80634e1389ed116100b05780634e1389ed146101435780636193cdfb14610163578063715018a61461017857600080fd5b806303aaf306146100d75780632dfdf0b51461010a5780633631797214610121575b600080fd5b3480156100e357600080fd5b506100f76100f2366004611345565b61027e565b6040519081526020015b60405180910390f35b34801561011657600080fd5b506001546100f79081565b34801561012d57600080fd5b5061014161013c3660046113c7565b610573565b005b34801561014f57600080fd5b5061014161015e366004611413565b610701565b34801561016f57600080fd5b50610141610b7c565b34801561018457600080fd5b50610141610bf0565b34801561019957600080fd5b506101416101a8366004611466565b610c04565b3480156101b957600080fd5b506000546040516001600160a01b039091168152602001610101565b3480156101e157600080fd5b506101416101f036600461147f565b610ce0565b34801561020157600080fd5b506100f760025481565b34801561021757600080fd5b5061023b6102263660046114c1565b60036020526000908152604090205460ff1681565b6040519015158152602001610101565b6100f76102593660046114e3565b610e62565b34801561026a57600080fd5b506101416102793660046114c1565b6110fd565b600061028a8383610ce0565b60008881526004602081905260409091209081015460ff166102f35760405162461bcd60e51b815260206004820181905260248201527f50325049583a204465706f736974206e6f742076616c696420616e796d6f726560448201526064015b60405180910390fd5b848160020154101561036d5760405162461bcd60e51b815260206004820152602c60248201527f50325049583a204e6f7420656e6f75676820746f6b656e2072656d61696e696e60448201527f67206f6e206465706f736974000000000000000000000000000000000000000060648201526084016102ea565b60408051602081018b9052908101869052606089811b6bffffffffffffffffffffffff1916908201526074016040516020818303038152906040528051906020012091504360056000848152602001908152602001600020600501541061043c5760405162461bcd60e51b815260206004820152603360248201527f50325049583a20416e6f74686572206c6f636b20776974682073616d6520494460448201527f206973206e6f742065787069726564207965740000000000000000000000000060648201526084016102ea565b60006040518060c001604052808b81526020018a6001600160a01b03168152602001896001600160a01b03168152602001888152602001878152602001600254436104879190611580565b9052600084815260056020818152604080842085518155918501516001830180546001600160a01b0392831673ffffffffffffffffffffffffffffffffffffffff199182161790915591860151600280850180549290931691909316179055606085015160038301556080850151600483015560a0850151919092015584018054929350889290919061051b908490611598565b9091555050604080518b81526020810188905284916001600160a01b038c16917f2a28b2ae47b0bd4b104e7cd29b1dfa72846af8c4cfdc009da2ae29db68cb67ea910160405180910390a35050979650505050505050565b60008381526004602052604090205483906001600160a01b031633146105f05760405162461bcd60e51b815260206004820152602c60248201527f50325049583a204f6e6c792073656c6c657220636f756c642063616c6c20746860448201526b34b990333ab731ba34b7b71760a11b60648201526084016102ea565b6105fa8383610ce0565b60008481526004602081905260409091209081015460ff16156106205761062085610c04565b60018101548154600283015460405163a9059cbb60e01b81526001600160a01b0392831660048201526024810191909152911690819063a9059cbb90604401602060405180830381600087803b15801561067957600080fd5b505af115801561068d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b191906115af565b506002820180546000909155604080518881526020810183905233917f7719804546c0185709e60c90d164447ff251a5ba29af0216faa921350f6bebf7910160405180910390a250505050505050565b60008581526005602081905260409091209081015443108015610728575060008160040154115b61079a5760405162461bcd60e51b815260206004820152602860248201527f50325049583a204c6f636b20616c72656164792072656c6561736564206f722060448201527f72657475726e656400000000000000000000000000000000000000000000000060648201526084016102ea565b805460009081526004602081815260408084209285015490519293926107c8926005860192918b910161160c565b60405160208183030381529060405280519060200120905060008160405160200161081f91907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60408051601f1981840301815291815281516020928301206000858152600690935291205490915060ff16156108bd5760405162461bcd60e51b815260206004820152603160248201527f50325049583a205472616e73616374696f6e20616c726561647920757365642060448201527f746f20756e6c6f636b207061796d656e7400000000000000000000000000000060648201526084016102ea565b6040805160008082526020820180845284905260ff881692820192909252606081018990526080810188905260019060a0016020604051602081039080840390855afa158015610911573d6000803e3d6000fd5b505060408051601f1901516001600160a01b03811660009081526003602052919091205490925060ff1690506109955760405162461bcd60e51b815260206004820152602360248201527f50325049583a205369676e6572206973206e6f7420612076616c6964207369676044820152623732b960e91b60648201526084016102ea565b60018085015490860154600387015460048801546001600160a01b039384169384Line truncated
|
||||
"bytecode": "0x60806040526001805560405162001806380380620018068339810160408190526200002a9162000123565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a350600382905580516000905b80821015620000d6576000620000ae8484815181106200009a576200009a62000203565b6020026020010151620000e060201b60201c565b6000908152600460205260409020805460ff1916600190811790915592909201915062000076565b5050505062000219565b600c1b611000600160ac1b031690565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200011e57600080fd5b919050565b600080604083850312156200013757600080fd5b8251602080850151919350906001600160401b03808211156200015957600080fd5b818601915086601f8301126200016e57600080fd5b815181811115620001835762000183620000f0565b8060051b604051601f19603f83011681018181108582111715620001ab57620001ab620000f0565b604052918252848201925083810185019189831115620001ca57600080fd5b938501935b82851015620001f357620001e38562000106565b84529385019392850192620001cf565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b6115dd80620002296000396000f3fe6080604052600436106100e85760003560e01c80636193cdfb1161008a5780638e2a3d36116100595780638e2a3d36146102f55780639872dbfe1461032757806398a268711461033d578063bfe07da61461037d57600080fd5b80636193cdfb1461026857806372fada5c1461027d5780638da5cb5b1461029d5780638e2749d6146102d557600080fd5b80632dfdf0b5116100c65780632dfdf0b5146101d857806336317972146101ef5780634b2ae9801461020f5780634e1389ed1461024857600080fd5b806303aaf306146100ed57806313af40351461012057806316d7224014610142575b600080fd5b3480156100f957600080fd5b5061010d6101083660046111e7565b610390565b6040519081526020015b60405180910390f35b34801561012c57600080fd5b5061014061013b366004611269565b61053a565b005b34801561014e57600080fd5b5061019f61015d366004611284565b60066020526000908152604090208054600182015460028301546003840154600485015460059095015493949293919290916001600160a01b03918216911686565b6040805196875260208701959095529385019290925260608401526001600160a01b0390811660808401521660a082015260c001610117565b3480156101e457600080fd5b5060025461010d9081565b3480156101fb57600080fd5b5061014061020a36600461129d565b6105e0565b34801561021b57600080fd5b5061010d61022a366004611269565b600c1b750ffffffffffffffffffffffffffffffffffffffff0001690565b34801561025457600080fd5b506101406102633660046112e9565b6106a0565b34801561027457600080fd5b50610140610962565b34801561028957600080fd5b50610140610298366004611284565b6109f2565b3480156102a957600080fd5b506000546102bd906001600160a01b031681565b6040516001600160a01b039091168152602001610117565b3480156102e157600080fd5b506101406102f036600461133c565b610a7a565b34801561030157600080fd5b50610315610310366004611284565b610b76565b6040516101179695949392919061137e565b34801561033357600080fd5b5061010d60035481565b34801561034957600080fd5b5061036d610358366004611284565b60046020526000908152604090205460ff1681565b6040519015158152602001610117565b61010d61038b36600461140c565b610c46565b600061039a610e00565b6103a48383610a7a565b60008881526005602052604090206004810154600160a01b900460ff166103de57604051635972996f60e11b815260040160405180910390fd5b8054851115610400576040516308aeed0f60e21b815260040160405180910390fd5b61040b89868a610e2b565b915060006040518060c001604052808b81526020018881526020018781526020016003544361043a91906114a9565b81526001600160a01b03808c166020808401919091528b82166040938401526000878152600682528381208551815591850151600183015592840151600282015560608401516003820155608084015160048201805491841673ffffffffffffffffffffffffffffffffffffffff1992831617905560a085015160059092018054929093169116179055835491925087918491906104d99084906114c1565b9091555050604080518b81526020810188905284916001600160a01b038c16917f2a28b2ae47b0bd4b104e7cd29b1dfa72846af8c4cfdc009da2ae29db68cb67ea910160405180910390a3505061052f60018055565b979650505050505050565b6000546001600160a01b031633146105885760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b6105e8610e00565b6105f183610eaf565b6105fb8282610a7a565b60008381526005602052604090206004810154600160a01b900460ff1615156001141561062b5761062b846109f2565b600481015481546000835560038301546001600160a01b03928316926106549184911683610eec565b604080518781526020810183905233917f7719804546c0185709e60c90d164447ff251a5ba29af0216faa921350f6bebf7910160405180910390a250505061069b60018055565b505050565b6106a8610e00565b6000858152600660205260409020600381015443108015906106cc57506002810154155b156106ea576040516331da482760e11b815260040160405180910390fd5b80546000908152600560209081526040808320600280860154925191949361071893918601928b9101611513565b60405160208183030381529060405280519060200120905060008160405160200161076f91907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60408051601f19818403018152918152815160209283012060008581526007909352Line truncated
|
||||
"deployedBytecode": "0x6080604052600436106100e85760003560e01c80636193cdfb1161008a5780638e2a3d36116100595780638e2a3d36146102f55780639872dbfe1461032757806398a268711461033d578063bfe07da61461037d57600080fd5b80636193cdfb1461026857806372fada5c1461027d5780638da5cb5b1461029d5780638e2749d6146102d557600080fd5b80632dfdf0b5116100c65780632dfdf0b5146101d857806336317972146101ef5780634b2ae9801461020f5780634e1389ed1461024857600080fd5b806303aaf306146100ed57806313af40351461012057806316d7224014610142575b600080fd5b3480156100f957600080fd5b5061010d6101083660046111e7565b610390565b6040519081526020015b60405180910390f35b34801561012c57600080fd5b5061014061013b366004611269565b61053a565b005b34801561014e57600080fd5b5061019f61015d366004611284565b60066020526000908152604090208054600182015460028301546003840154600485015460059095015493949293919290916001600160a01b03918216911686565b6040805196875260208701959095529385019290925260608401526001600160a01b0390811660808401521660a082015260c001610117565b3480156101e457600080fd5b5060025461010d9081565b3480156101fb57600080fd5b5061014061020a36600461129d565b6105e0565b34801561021b57600080fd5b5061010d61022a366004611269565b600c1b750ffffffffffffffffffffffffffffffffffffffff0001690565b34801561025457600080fd5b506101406102633660046112e9565b6106a0565b34801561027457600080fd5b50610140610962565b34801561028957600080fd5b50610140610298366004611284565b6109f2565b3480156102a957600080fd5b506000546102bd906001600160a01b031681565b6040516001600160a01b039091168152602001610117565b3480156102e157600080fd5b506101406102f036600461133c565b610a7a565b34801561030157600080fd5b50610315610310366004611284565b610b76565b6040516101179695949392919061137e565b34801561033357600080fd5b5061010d60035481565b34801561034957600080fd5b5061036d610358366004611284565b60046020526000908152604090205460ff1681565b6040519015158152602001610117565b61010d61038b36600461140c565b610c46565b600061039a610e00565b6103a48383610a7a565b60008881526005602052604090206004810154600160a01b900460ff166103de57604051635972996f60e11b815260040160405180910390fd5b8054851115610400576040516308aeed0f60e21b815260040160405180910390fd5b61040b89868a610e2b565b915060006040518060c001604052808b81526020018881526020018781526020016003544361043a91906114a9565b81526001600160a01b03808c166020808401919091528b82166040938401526000878152600682528381208551815591850151600183015592840151600282015560608401516003820155608084015160048201805491841673ffffffffffffffffffffffffffffffffffffffff1992831617905560a085015160059092018054929093169116179055835491925087918491906104d99084906114c1565b9091555050604080518b81526020810188905284916001600160a01b038c16917f2a28b2ae47b0bd4b104e7cd29b1dfa72846af8c4cfdc009da2ae29db68cb67ea910160405180910390a3505061052f60018055565b979650505050505050565b6000546001600160a01b031633146105885760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b6105e8610e00565b6105f183610eaf565b6105fb8282610a7a565b60008381526005602052604090206004810154600160a01b900460ff1615156001141561062b5761062b846109f2565b600481015481546000835560038301546001600160a01b03928316926106549184911683610eec565b604080518781526020810183905233917f7719804546c0185709e60c90d164447ff251a5ba29af0216faa921350f6bebf7910160405180910390a250505061069b60018055565b505050565b6106a8610e00565b6000858152600660205260409020600381015443108015906106cc57506002810154155b156106ea576040516331da482760e11b815260040160405180910390fd5b80546000908152600560209081526040808320600280860154925191949361071893918601928b9101611513565b60405160208183030381529060405280519060200120905060008160405160200161076f91907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60408051601f1981840301815291815281516020928301206000858152600790935291205490915060ff161515600114156107bd57604051637a48537560e11b815260040160405180910390fd5b6040805160008082526020820180845284905260ff881692820192909252606081018990526080810188905261083f9060019060a0016020604051602081039080840390855afa158015610815573d6000803e3d6000fd5b5050604051601f190151600c1b750ffffffffffffffffffffffffffffffffffffffff00016919050565b60008181526004602052604090205490915060ff1661087157604051632057875960e21b815260040160405180910390fd5b6004840154600186015460028701546001600160a01b0390921691600091610898916114c1565b60006002890181905560038901819055868152600760205260409020805460ff1916600117905560048801549091506108dc9083906001600160a01b031683610eec565b60018701541561090757600587015460018801546109079184916001600160a01b0390911690610eec565b60048701546040518d81526001600160a01b03909116907f5e420822d2f7281fdc4b763c62c8b7874bf22108a35efe93144d79296aacc67d9060200160405180910390a25050505050505061095b60018055565b5050505050565b6000546001600160a01b031633146109ab5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015260640161057f565b476109b63382610f78565bLine truncated
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"wallets":[
|
||||
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
||||
"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
|
||||
]
|
||||
}
|
||||
+18
-2
@@ -1,5 +1,21 @@
|
||||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import SearchComponent from "../components/SearchComponent.vue";
|
||||
import blockchain from "../utils/blockchain";
|
||||
|
||||
const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
|
||||
// finish buy screen
|
||||
console.log(selectedDeposit);
|
||||
let depositDetail;
|
||||
await blockchain
|
||||
.mapDeposits(selectedDeposit["args"]["depositID"])
|
||||
.then((deposit) => (depositDetail = deposit));
|
||||
console.log(tokenValue);
|
||||
console.log(depositDetail);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h2 v-bind:hidden="true">Home View</h2>
|
||||
<SearchComponent @token-buy="confirmBuyClick" />
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,101 @@
|
||||
<script setup lang="ts">
|
||||
import type { BigNumber } from "ethers";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { useEtherStore } from "../store/ether";
|
||||
import blockchain from "../utils/blockchain";
|
||||
|
||||
const etherStore = useEtherStore();
|
||||
|
||||
const { depositList } = storeToRefs(etherStore);
|
||||
|
||||
const depositValue = ref<Number>();
|
||||
const depositPixKey = ref<string>("");
|
||||
|
||||
const splitTokens = () => {
|
||||
blockchain.splitTokens();
|
||||
};
|
||||
|
||||
const mockDeposit = () => {
|
||||
if (!depositValue.value || !depositPixKey.value) return;
|
||||
blockchain.mockDeposit(depositValue.value.toString(), depositPixKey.value);
|
||||
};
|
||||
|
||||
const countDeposit = () => {
|
||||
blockchain.countDeposit();
|
||||
};
|
||||
|
||||
const mapDeposit = (depositId: BigNumber) => {
|
||||
blockchain.mapDeposits(depositId);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="flex flex-col gap-4 justify-start items-start w-2/3">
|
||||
<button type="button" class="default-button" @click="countDeposit()">
|
||||
Contar depósitos
|
||||
</button>
|
||||
|
||||
<div class="flex gap-4 w-full justify-between">
|
||||
<input
|
||||
type="number"
|
||||
class="default-input"
|
||||
placeholder="Quantidade de tokens"
|
||||
v-model="depositValue"
|
||||
/>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
class="default-input"
|
||||
placeholder="Chave pix"
|
||||
v-model="depositPixKey"
|
||||
/>
|
||||
|
||||
<button type="button" class="default-button" @click="mockDeposit()">
|
||||
Mockar depósitos
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="default-button" @click="splitTokens()">
|
||||
Dividir tokens
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<ul class="flex flex-col justify-center items-center gap-4">
|
||||
<li
|
||||
class="text-gray-900 font-semibold text-lg cursor-pointer border-2 border-amber-400 p-2 rounded-md bg-amber-200"
|
||||
v-for="deposit in depositList"
|
||||
:key="deposit['blockNumber']"
|
||||
@click="mapDeposit(deposit['args']['depositID'])"
|
||||
>
|
||||
Address:<br />{{ deposit["args"]["0"] }}<br />
|
||||
MRBZ: {{ blockchain.formatEther(deposit["args"]["amount"]) }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
header {
|
||||
@apply flex flex-row justify-between w-full items-center;
|
||||
}
|
||||
|
||||
.default-button {
|
||||
@apply p-2 rounded border-2 border-amber-400 text-gray-50 font-extrabold text-base w-full;
|
||||
}
|
||||
|
||||
.default-input {
|
||||
@apply border-none outline-none text-lg text-gray-900 w-64 p-2 rounded-lg;
|
||||
}
|
||||
|
||||
.page {
|
||||
@apply flex gap-8 mt-24;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.page {
|
||||
@apply flex-wrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user