{"version":3,"sources":["redux/blockchain/blockchainReducer.js","redux/data/dataReducer.js","redux/store.js","redux/data/dataActions.js","redux/blockchain/blockchainActions.js","styles/globalStyles.js","App.js","reportWebVitals.js","index.js"],"names":["initialState","loading","account","smartContract","web3","errorMsg","blockchainReducer","state","action","type","payload","totalSupply","cost","error","dataReducer","rootReducer","combineReducers","blockchain","data","middleware","thunk","composeEnhancers","compose","applyMiddleware","store","createStore","fetchDataFailed","fetchData","dispatch","a","getState","methods","call","console","log","connectFailed","updateAccount","Screen","styled","div","image","SpacerXSmall","SpacerSmall","SpacerMedium","Container","flex","fd","jc","ai","TextTitle","p","TextDescription","StyledButton","button","ResponsiveWrapper","StyledLink","img","App","input","len","useDispatch","useSelector","useState","claimingNft","setClaimingNft","feedback","setFeedback","mintAmount","CONTRACT_ADDRESS","SCAN_LINK","NETWORK","NAME","SYMBOL","ID","NFT_NAME","MAX_SUPPLY","WEI_COST","DISPLAY_COST","GAS_LIMIT","MARKETPLACE","MARKETPLACE_LINK","SHOW_BACKGROUND","CONFIG","SET_CONFIG","getData","getConfig","fetch","headers","Accept","configResponse","json","config","useEffect","style","padding","test","textAlign","fontSize","fontWeight","color","target","href","length","substring","Number","onClick","e","preventDefault","abiResponse","abi","window","ethereum","isMetaMask","Web3EthContract","setProvider","Web3","request","method","accounts","SmartContractObj","on","location","reload","disabled","gasLimit","totalCostWei","String","totalGasLimit","mint","send","to","from","value","once","err","then","receipt","claimNFTs","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","document","getElementById"],"mappings":"swBAAMA,EAAe,CACnBC,SAAS,EACTC,QAAS,KACTC,cAAe,KACfC,KAAM,KACNC,SAAU,IAkCGC,EA/BW,WAAmC,IAAlCC,EAAiC,uDAAzBP,EAAcQ,EAAW,uCAC1D,OAAQA,EAAOC,MACb,IAAK,qBACH,OAAO,2BACFT,GADL,IAEEC,SAAS,IAEb,IAAK,qBACH,OAAO,2BACFM,GADL,IAEEN,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IAAIsG,GACZtE,EAAY,WAAD,OACEgB,EAAOR,SADT,iBAGXV,GAAe,GACfpC,EAASD,EAAUV,EAAWf,aA2JZuI,GACArD,KALJ,SAQGrB,EAAc,YAAc,sBAOzC,eAAC,EAAD,cC9QG2E,GAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,8BAAqBL,MAAK,YAAkD,IAA/CM,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,O,OCCdO,IAASC,OACP,eAAC,IAAD,CAAU3H,MAAOA,EAAjB,SACE,eAAC,GAAD,MAEF4H,SAASC,eAAe,SAM1BX,O","file":"static/js/main.a4485baa.chunk.js","sourcesContent":["const initialState = {\r\n loading: false,\r\n account: null,\r\n smartContract: null,\r\n web3: null,\r\n errorMsg: \"\",\r\n};\r\n\r\nconst blockchainReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case \"CONNECTION_REQUEST\":\r\n return {\r\n ...initialState,\r\n loading: true,\r\n };\r\n case \"CONNECTION_SUCCESS\":\r\n return {\r\n ...state,\r\n loading: false,\r\n account: action.payload.account,\r\n smartContract: action.payload.smartContract,\r\n web3: action.payload.web3,\r\n };\r\n case \"CONNECTION_FAILED\":\r\n return {\r\n ...initialState,\r\n loading: false,\r\n errorMsg: action.payload,\r\n };\r\n case \"UPDATE_ACCOUNT\":\r\n return {\r\n ...state,\r\n account: action.payload.account,\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default blockchainReducer;\r\n","const initialState = {\r\n loading: false,\r\n totalSupply: 0,\r\n cost: 0,\r\n error: false,\r\n errorMsg: \"\",\r\n};\r\n\r\nconst dataReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case \"CHECK_DATA_REQUEST\":\r\n return {\r\n ...state,\r\n loading: true,\r\n error: false,\r\n errorMsg: \"\",\r\n };\r\n case \"CHECK_DATA_SUCCESS\":\r\n return {\r\n ...state,\r\n loading: false,\r\n totalSupply: action.payload.totalSupply,\r\n // cost: action.payload.cost,\r\n error: false,\r\n errorMsg: \"\",\r\n };\r\n case \"CHECK_DATA_FAILED\":\r\n return {\r\n ...initialState,\r\n loading: false,\r\n error: true,\r\n errorMsg: action.payload,\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default dataReducer;\r\n","import { applyMiddleware, compose, createStore, combineReducers } from \"redux\";\r\nimport thunk from \"redux-thunk\";\r\nimport blockchainReducer from \"./blockchain/blockchainReducer\";\r\nimport dataReducer from \"./data/dataReducer\";\r\n\r\nconst rootReducer = combineReducers({\r\n blockchain: blockchainReducer,\r\n data: dataReducer,\r\n});\r\n\r\nconst middleware = [thunk];\r\nconst composeEnhancers = compose(applyMiddleware(...middleware));\r\n\r\nconst configureStore = () => {\r\n return createStore(rootReducer, composeEnhancers);\r\n};\r\n\r\nconst store = configureStore();\r\n\r\nexport default store;\r\n","// log\r\nimport store from \"../store\";\r\n\r\nconst fetchDataRequest = () => {\r\n return {\r\n type: \"CHECK_DATA_REQUEST\",\r\n };\r\n};\r\n\r\nconst fetchDataSuccess = (payload) => {\r\n return {\r\n type: \"CHECK_DATA_SUCCESS\",\r\n payload: payload,\r\n };\r\n};\r\n\r\nconst fetchDataFailed = (payload) => {\r\n return {\r\n type: \"CHECK_DATA_FAILED\",\r\n payload: payload,\r\n };\r\n};\r\n\r\nexport const fetchData = () => {\r\n return async (dispatch) => {\r\n dispatch(fetchDataRequest());\r\n try {\r\n let totalSupply = await store\r\n .getState()\r\n .blockchain.smartContract.methods.totalSupply()\r\n .call();\r\n // let cost = await store\r\n // .getState()\r\n // .blockchain.smartContract.methods.cost()\r\n // .call();\r\n\r\n dispatch(\r\n fetchDataSuccess({\r\n totalSupply,\r\n // cost,\r\n })\r\n );\r\n } catch (err) {\r\n console.log(err);\r\n dispatch(fetchDataFailed(\"Could not load data from contract.\"));\r\n }\r\n };\r\n};\r\n","// constants\r\nimport Web3EthContract from \"web3-eth-contract\";\r\nimport Web3 from \"web3\";\r\n// log\r\nimport { fetchData } from \"../data/dataActions\";\r\n\r\nconst connectRequest = () => {\r\n return {\r\n type: \"CONNECTION_REQUEST\",\r\n };\r\n};\r\n\r\nconst connectSuccess = (payload) => {\r\n return {\r\n type: \"CONNECTION_SUCCESS\",\r\n payload: payload,\r\n };\r\n};\r\n\r\nconst connectFailed = (payload) => {\r\n return {\r\n type: \"CONNECTION_FAILED\",\r\n payload: payload,\r\n };\r\n};\r\n\r\nconst updateAccountRequest = (payload) => {\r\n return {\r\n type: \"UPDATE_ACCOUNT\",\r\n payload: payload,\r\n };\r\n};\r\n\r\nexport const connect = () => {\r\n return async (dispatch) => {\r\n dispatch(connectRequest());\r\n const abiResponse = await fetch(\"/config/abi.json\", {\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n Accept: \"application/json\",\r\n },\r\n });\r\n const abi = await abiResponse.json();\r\n const configResponse = await fetch(\"/config/config.json\", {\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n Accept: \"application/json\",\r\n },\r\n });\r\n const CONFIG = await configResponse.json();\r\n const { ethereum } = window;\r\n const metamaskIsInstalled = ethereum && ethereum.isMetaMask;\r\n if (metamaskIsInstalled) {\r\n Web3EthContract.setProvider(ethereum);\r\n let web3 = new Web3(ethereum);\r\n try {\r\n const accounts = await ethereum.request({\r\n method: \"eth_requestAccounts\",\r\n });\r\n const networkId = await ethereum.request({\r\n method: \"net_version\",\r\n });\r\n if (networkId == CONFIG.NETWORK.ID) {\r\n const SmartContractObj = new Web3EthContract(\r\n abi,\r\n CONFIG.CONTRACT_ADDRESS\r\n );\r\n dispatch(\r\n connectSuccess({\r\n account: accounts[0],\r\n smartContract: SmartContractObj,\r\n web3: web3,\r\n })\r\n );\r\n // Add listeners start\r\n ethereum.on(\"accountsChanged\", (accounts) => {\r\n dispatch(updateAccount(accounts[0]));\r\n });\r\n ethereum.on(\"chainChanged\", () => {\r\n window.location.reload();\r\n });\r\n // Add listeners end\r\n } else {\r\n dispatch(connectFailed(`Change network to ${CONFIG.NETWORK.NAME}.`));\r\n }\r\n } catch (err) {\r\n dispatch(connectFailed(\"Something went wrong.\"));\r\n }\r\n } else {\r\n dispatch(connectFailed(\"Install Metamask.\"));\r\n }\r\n };\r\n};\r\n\r\nexport const updateAccount = (account) => {\r\n return async (dispatch) => {\r\n dispatch(updateAccountRequest({ account: account }));\r\n dispatch(fetchData(account));\r\n };\r\n};\r\n","import styled from \"styled-components\";\n\n// Used for wrapping a page component\nexport const Screen = styled.div`\n background-color: var(--primary);\n background-image: ${({ image }) => (image ? `url(${image})` : \"none\")};\n background-size: cover;\n background-position: center;\n width: 100%;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n`;\n\n// Used for providing space between components\nexport const SpacerXSmall = styled.div`\n height: 8px;\n width: 8px;\n`;\n\n// Used for providing space between components\nexport const SpacerSmall = styled.div`\n height: 16px;\n width: 16px;\n`;\n\n// Used for providing space between components\nexport const SpacerMedium = styled.div`\n height: 24px;\n width: 24px;\n`;\n\n// Used for providing space between components\nexport const SpacerLarge = styled.div`\n height: 32px;\n width: 32px;\n`;\n\n// Used for providing a wrapper around a component\nexport const Container = styled.div`\n display: flex;\n flex: ${({ flex }) => (flex ? flex : 0)};\n flex-direction: ${({ fd }) => (fd ? fd : \"column\")};\n justify-content: ${({ jc }) => (jc ? jc : \"flex-start\")};\n align-items: ${({ ai }) => (ai ? ai : \"flex-start\")};\n width: 100%;\n max-height: 40vh;\n`;\n\nexport const TextTitle = styled.p`\n color: var(--primary-text);\n font-size: 22px;\n font-weight: 500;\n line-height: 1.6;\n`;\n\nexport const TextSubTitle = styled.p`\n color: var(--primary-text);\n font-size: 18px;\n line-height: 1.6;\n`;\n\nexport const TextDescription = styled.p`\n color: var(--primary-text);\n font-size: 16px;\n line-height: 1.6;\n`;\n\nexport const StyledClickable = styled.div`\n :active {\n opacity: 0.6;\n }\n`;\n","import React, { useEffect, useState, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { connect } from \"./redux/blockchain/blockchainActions\";\nimport { fetchData } from \"./redux/data/dataActions\";\nimport * as s from \"./styles/globalStyles\";\nimport styled from \"styled-components\";\n\nconst truncate = (input, len) =>\n input.length > len ? `${input.substring(0, len)}...` : input;\n\nexport const StyledButton = styled.button`\npadding-right: 40px;\npadding-left: 40px;\n-webkit-box-flex: 0;\n-webkit-flex: 0 auto;\n-ms-flex: 0 auto;\nflex: 0 auto;\nbackground-color: #000;\nfont-size: 60px;\nline-height: 60px;\ntext-align: left;\ncolor: white;\n }\n`;\n\nexport const StyledRoundButton = styled.button`\ndisplay: none;\n`;\n\nexport const ResponsiveWrapper = styled.div`\nmargin: 0;\npadding: 0;\n`;\n\nexport const StyledLogo = styled.img`\n width: 200px;\n @media (min-width: 767px) {\n width: 300px;\n }\n transition: width 0.5s;\n transition: height 0.5s;\n`;\n\nexport const StyledImg = styled.img`\n border: 4px dashed var(--secondary);\n background-color: var(--accent);\n border-radius: 100%;\n width: 200px;\n @media (min-width: 900px) {\n width: 250px;\n }\n @media (min-width: 1000px) {\n width: 300px;\n }\n transition: width 0.5s;\n`;\n\nexport const StyledLink = styled.a`\n color: var(--secondary);\n text-decoration: none;\n`;\n\nfunction App() {\n const dispatch = useDispatch();\n const blockchain = useSelector((state) => state.blockchain);\n const data = useSelector((state) => state.data);\n const [claimingNft, setClaimingNft] = useState(false);\n const [feedback, setFeedback] = useState(`CLICK TO MINT.`);\n const [mintAmount, setMintAmount] = useState(1);\n const [CONFIG, SET_CONFIG] = useState({\n CONTRACT_ADDRESS: \"\",\n SCAN_LINK: \"\",\n NETWORK: {\n NAME: \"\",\n SYMBOL: \"\",\n ID: 0,\n },\n NFT_NAME: \"\",\n SYMBOL: \"\",\n MAX_SUPPLY: 1,\n WEI_COST: 0,\n DISPLAY_COST: 0,\n GAS_LIMIT: 0,\n MARKETPLACE: \"\",\n MARKETPLACE_LINK: \"\",\n SHOW_BACKGROUND: false,\n });\n\n const claimNFTs = () => {\n let cost = CONFIG.WEI_COST;\n let gasLimit = CONFIG.GAS_LIMIT;\n let totalCostWei = String(cost * mintAmount);\n let totalGasLimit = String(gasLimit * mintAmount);\n console.log(\"Cost: \", totalCostWei);\n console.log(\"Gas limit: \", totalGasLimit);\n setFeedback(`Minting your ${CONFIG.NFT_NAME}...`);\n setClaimingNft(true);\n blockchain.smartContract.methods\n .mint(mintAmount)\n .send({\n gasLimit: String(totalGasLimit),\n to: CONFIG.CONTRACT_ADDRESS,\n from: blockchain.account,\n value: totalCostWei,\n })\n .once(\"error\", (err) => {\n console.log(err);\n setFeedback(\"SOMETHING IS WRONG.\");\n setClaimingNft(false);\n })\n .then((receipt) => {\n console.log(receipt);\n setFeedback(\n `HSSSSS! ${CONFIG.NFT_NAME} HAS AWOKEN!`\n );\n setClaimingNft(false);\n dispatch(fetchData(blockchain.account));\n });\n };\n\n const decrementMintAmount = () => {\n let newMintAmount = mintAmount - 1;\n if (newMintAmount < 1) {\n newMintAmount = 1;\n }\n setMintAmount(newMintAmount);\n };\n\n const incrementMintAmount = () => {\n let newMintAmount = mintAmount + 1;\n if (newMintAmount > 10) {\n newMintAmount = 10;\n }\n setMintAmount(newMintAmount);\n };\n\n const getData = () => {\n if (blockchain.account !== \"\" && blockchain.smartContract !== null) {\n dispatch(fetchData(blockchain.account));\n }\n };\n\n const getConfig = async () => {\n const configResponse = await fetch(\"/config/config.json\", {\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n });\n const config = await configResponse.json();\n SET_CONFIG(config);\n };\n\n useEffect(() => {\n getConfig();\n }, []);\n\n useEffect(() => {\n getData();\n }, [blockchain.account]);\n\n return (\n \n \n \n \n \n {data.totalSupply} / {CONFIG.MAX_SUPPLY}\n \n \n \n {truncate(CONFIG.CONTRACT_ADDRESS, 15)}\n \n \n \n {Number(data.totalSupply) >= CONFIG.MAX_SUPPLY ? (\n <>\n \n ALL VAMPIRES HAVE AWOKEN.\n \n \n AWOKEN {CONFIG.NFT_NAME} ON\n \n \n \n {CONFIG.MARKETPLACE}\n 21\n \n ) : (\n <>\n \n {CONFIG.NFT_NAME} ARE {CONFIG.DISPLAY_COST}.\n \n \n \n ONE PER TXN.\n \n \n {blockchain.account === \"\" ||\n blockchain.smartContract === null ? (\n \n {\n e.preventDefault();\n dispatch(connect());\n getData();\n }}\n >\n CONNECT\n \n {blockchain.errorMsg !== \"\" ? (\n <>\n \n \n {blockchain.errorMsg}\n \n \n ) : null}\n \n ) : (\n <>\n \n {feedback}\n \n \n \n \n {\n e.preventDefault();\n claimNFTs();\n getData();\n }}\n >\n {claimingNft ? \"AWAKENING\" : \"FREE MINT\"}\n \n \n \n )}\n \n )}\n \n \n \n \n \n );\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App from \"./App\";\r\nimport reportWebVitals from \"./reportWebVitals\";\r\nimport store from \"./redux/store\";\r\nimport { Provider } from \"react-redux\";\r\nimport \"./styles/reset.css\";\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById(\"root\")\r\n);\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n"],"sourceRoot":""}