|
|
|
@ -4,6 +4,13 @@ import './App.css';
|
|
|
|
|
|
|
|
|
|
import Web3 from 'web3';
|
|
|
|
|
|
|
|
|
|
const web3 = new Web3(Web3.givenProvider);
|
|
|
|
|
|
|
|
|
|
import { Airdrop } from 'airdrop-artifact';
|
|
|
|
|
|
|
|
|
|
const airdropAddress = "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512";
|
|
|
|
|
const airdropContract = new web3.eth.Contract(Airdrop as any, airdropAddress);
|
|
|
|
|
|
|
|
|
|
interface AddressesProps {
|
|
|
|
|
addressList: string[];
|
|
|
|
|
setAddressListFn: any;
|
|
|
|
@ -17,13 +24,13 @@ function Addresses(props: AddressesProps) {
|
|
|
|
|
const save = () => {
|
|
|
|
|
console.log(inputState);
|
|
|
|
|
//TODO check if correct address format
|
|
|
|
|
if (!Web3.utils.isAddress(inputState)) {
|
|
|
|
|
if (!web3.utils.isAddress(inputState)) {
|
|
|
|
|
setErrorText("Invalid ETH address");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
setErrorText("");
|
|
|
|
|
|
|
|
|
|
const checksumAddr = Web3.utils.toChecksumAddress(inputState);
|
|
|
|
|
const checksumAddr = web3.utils.toChecksumAddress(inputState);
|
|
|
|
|
|
|
|
|
|
if (addressList.includes(checksumAddr)) {
|
|
|
|
|
//Do nothing
|
|
|
|
|