From 3ab93a62d8c557a4a6d16a9815ae4fcb71578d2c Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Thu, 8 Dec 2022 00:11:01 -0800 Subject: [PATCH] Working on token --- src/App.tsx | 13 ++++++++++--- tsconfig.json | 2 -- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index aa8444d..a8184dd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,10 +11,14 @@ import { publicProvider } from 'wagmi/providers/public' const web3 = new Web3(Web3.givenProvider); import Airdrop from "./Airdrop.json"; +import MagnaToken from "./MagnaToken.json"; const airdropAddress = "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"; const airdropContract = new web3.eth.Contract(Airdrop.abi as any, airdropAddress); +const magnaTokenAddress = "0x5FbDB2315678afecb367f032d93F642f64180aa3"; +const magnaTokenContract = new web3.eth.Contract(MagnaToken.abi as any, magnaTokenAddress); + const { chains, provider, webSocketProvider } = configureChains([mainnet], [publicProvider()]); const wagmiClient = createClient({ @@ -142,12 +146,15 @@ function App() { async function performAirdrop() { console.log("Performing airdrop"); - console.log(airdropContract.methods); + console.log(magnaTokenContract.methods); - const allowance = await airdropContract.methods.allowance(ownerAddress, airdropAddress).call({ from: ownerAddress }); + const allowance = await magnaTokenContract.methods.allowance(ownerAddress, airdropAddress).call({ from: ownerAddress }); console.log(`Allowance: ${allowance}`); - + if (allowance <= 0) { + //TODO prompt to set a positive balance + return; + } } return ( diff --git a/tsconfig.json b/tsconfig.json index 3e6bc74..69952d6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,10 +8,8 @@ "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, - "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, - "isolatedModules": true, "noEmit": true, "jsx": "react-jsx" },