Compare commits

..

No commits in common. "3ab93a62d8c557a4a6d16a9815ae4fcb71578d2c" and "13fcce3c8e8b6660aa908a0afd35293cccf31c64" have entirely different histories.

3 changed files with 2 additions and 302 deletions

View File

@ -11,14 +11,10 @@ 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({
@ -50,7 +46,6 @@ function Profile() {
return (
<div>
<div>Connect to Airdrop App</div>
{connectors.map((connector) => (
<button
disabled={!connector.ready}
@ -141,20 +136,9 @@ function AddressList({addressList}: AddressListProps) {
function App() {
const [addressList, setAddressList] = useState([]);
const { address: ownerAddress } = useAccount()
async function performAirdrop() {
console.log("Performing airdrop");
console.log(magnaTokenContract.methods);
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 (

File diff suppressed because one or more lines are too long

View File

@ -8,8 +8,10 @@
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},