├── .gitignore
├── LICENSE
├── README.md
├── contracts
├── LipToken.sol
└── Migrations.sol
├── migrations
├── 1_initial_migration.js
└── 2_lip_token_migration.js
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── src
├── App.css
├── App.js
├── App.test.js
├── assets
│ └── images
│ │ ├── bg
│ │ └── _color.png
│ │ ├── parts
│ │ ├── ad
│ │ │ ├── 0.png
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ │ ├── am1
│ │ │ ├── 0.png
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ │ ├── am2
│ │ │ ├── 0.png
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ │ ├── am3
│ │ │ ├── 0.png
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ │ ├── b
│ │ │ ├── 0.png
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ │ ├── l
│ │ │ ├── 0.png
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ │ └── m
│ │ │ ├── 0.png
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ │ ├── rarity
│ │ ├── _rarity_1.png
│ │ ├── _rarity_2.png
│ │ └── _rarity_3.png
│ │ └── wrapper
│ │ ├── _back.png
│ │ └── _wrapper.png
├── components
│ └── lipRenderer.js
├── contracts
│ ├── LipToken.json
│ └── Migrations.json
├── index.css
├── index.js
├── logo.svg
├── parts
│ └── parts.js
├── redux
│ ├── blockchain
│ │ ├── blockchainActions.js
│ │ └── blockchainReducer.js
│ ├── data
│ │ ├── dataActions.js
│ │ └── dataReducer.js
│ └── store.js
├── reportWebVitals.js
├── setupTests.js
└── styles
│ ├── globalStyles.js
│ ├── reset.css
│ └── theme.css
└── truffle-config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 |
40 | # Dependency directories
41 | node_modules/
42 | jspm_packages/
43 |
44 | # TypeScript v1 declaration files
45 | typings/
46 |
47 | # TypeScript cache
48 | *.tsbuildinfo
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Microbundle cache
57 | .rpt2_cache/
58 | .rts2_cache_cjs/
59 | .rts2_cache_es/
60 | .rts2_cache_umd/
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 | .env.test
74 |
75 | # parcel-bundler cache (https://parceljs.org/)
76 | .cache
77 |
78 | # Next.js build output
79 | .next
80 |
81 | # Nuxt.js build / generate output
82 | .nuxt
83 | dist
84 |
85 | # Gatsby files
86 | .cache/
87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
88 | # https://nextjs.org/blog/next-9-1#public-directory-support
89 | # public
90 |
91 | # vuepress build output
92 | .vuepress/dist
93 |
94 | # Serverless directories
95 | .serverless/
96 |
97 | # FuseBox cache
98 | .fusebox/
99 |
100 | # DynamoDB Local files
101 | .dynamodb/
102 |
103 | # TernJS port file
104 | .tern-port
105 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 HashLips
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Welcome to HashLips 👄
2 |
3 | All the code in these repos was created and explained by HashLips on the main YouTube channel.
4 |
5 | To find out more please visit:
6 |
7 | [📺 YouTube](https://www.youtube.com/channel/UC1LV4_VQGBJHTJjEWUmy8nA)
8 |
9 | [👄 Discord](https://discord.com/invite/qh6MWhMJDN)
10 |
11 | [💬 Telegram](https://t.me/hashlipsnft)
12 |
13 | [🐦 Twitter](https://twitter.com/hashlipsnft)
14 |
15 | [ℹ️ Website](https://hashlips.online/HashLips)
16 |
17 | # nft_game
18 | Learn how to create a NFT game and connect to a smart contract.
19 |
--------------------------------------------------------------------------------
/contracts/LipToken.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
6 | import "@openzeppelin/contracts/access/Ownable.sol";
7 |
8 | contract LipToken is ERC721, Ownable {
9 | constructor(string memory _name, string memory _symbol)
10 | ERC721(_name, _symbol)
11 | {}
12 |
13 | uint256 COUNTER;
14 |
15 | uint256 fee = 0.01 ether;
16 |
17 | struct Lip {
18 | string name;
19 | uint256 id;
20 | uint256 dna;
21 | uint8 level;
22 | uint8 rarity;
23 | }
24 |
25 | Lip[] public lips;
26 |
27 | event NewLip(address indexed owner, uint256 id, uint256 dna);
28 |
29 | // Helpers
30 | function _createRandomNum(uint256 _mod) internal view returns (uint256) {
31 | uint256 randomNum = uint256(
32 | keccak256(abi.encodePacked(block.timestamp, msg.sender))
33 | );
34 | return randomNum % _mod;
35 | }
36 |
37 | function updateFee(uint256 _fee) external onlyOwner {
38 | fee = _fee;
39 | }
40 |
41 | function withdraw() external payable onlyOwner {
42 | address payable _owner = payable(owner());
43 | _owner.transfer(address(this).balance);
44 | }
45 |
46 | // Creation
47 | function _createLip(string memory _name) internal {
48 | uint8 randRarity = uint8(_createRandomNum(100));
49 | uint256 randDna = _createRandomNum(10**16);
50 | Lip memory newLip = Lip(_name, COUNTER, randDna, 1, randRarity);
51 | lips.push(newLip);
52 | _safeMint(msg.sender, COUNTER);
53 | emit NewLip(msg.sender, COUNTER, randDna);
54 | COUNTER++;
55 | }
56 |
57 | function createRandomLip(string memory _name) public payable {
58 | require(msg.value >= fee);
59 | _createLip(_name);
60 | }
61 |
62 | // Getters
63 | function getLips() public view returns (Lip[] memory) {
64 | return lips;
65 | }
66 |
67 | function getOwnerLips(address _owner) public view returns (Lip[] memory) {
68 | Lip[] memory result = new Lip[](balanceOf(_owner));
69 | uint256 counter = 0;
70 | for (uint256 i = 0; i < lips.length; i++) {
71 | if (ownerOf(i) == _owner) {
72 | result[counter] = lips[i];
73 | counter++;
74 | }
75 | }
76 | return result;
77 | }
78 |
79 | // Actions
80 | function levelUp(uint256 _lipId) public {
81 | require(ownerOf(_lipId) == msg.sender);
82 | Lip storage lip = lips[_lipId];
83 | lip.level++;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.4.22 <0.9.0;
3 |
4 | contract Migrations {
5 | address public owner = msg.sender;
6 | uint public last_completed_migration;
7 |
8 | modifier restricted() {
9 | require(
10 | msg.sender == owner,
11 | "This function is restricted to the contract's owner"
12 | );
13 | _;
14 | }
15 |
16 | function setCompleted(uint completed) public restricted {
17 | last_completed_migration = completed;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | const Migrations = artifacts.require("Migrations");
2 |
3 | module.exports = function (deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/migrations/2_lip_token_migration.js:
--------------------------------------------------------------------------------
1 | const LipToken = artifacts.require("LipToken");
2 |
3 | module.exports = function (deployer) {
4 | deployer.deploy(LipToken, "LipTokens", "LIPS");
5 | };
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nft_game",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@openzeppelin/contracts": "^4.2.0",
7 | "@testing-library/jest-dom": "^5.11.4",
8 | "@testing-library/react": "^11.1.0",
9 | "@testing-library/user-event": "^12.1.10",
10 | "react": "^17.0.2",
11 | "react-dom": "^17.0.2",
12 | "react-redux": "^7.2.4",
13 | "react-scripts": "4.0.3",
14 | "redux": "^4.1.1",
15 | "redux-thunk": "^2.3.0",
16 | "styled-components": "^5.3.0",
17 | "web-vitals": "^1.0.1",
18 | "web3": "^1.5.1"
19 | },
20 | "scripts": {
21 | "start": "react-scripts start",
22 | "build": "react-scripts build",
23 | "test": "react-scripts test",
24 | "eject": "react-scripts eject"
25 | },
26 | "eslintConfig": {
27 | "extends": [
28 | "react-app",
29 | "react-app/jest"
30 | ]
31 | },
32 | "browserslist": {
33 | "production": [
34 | ">0.2%",
35 | "not dead",
36 | "not op_mini all"
37 | ],
38 | "development": [
39 | "last 1 chrome version",
40 | "last 1 firefox version",
41 | "last 1 safari version"
42 | ]
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 |
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/public/logo512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import "./App.css";
3 | import { useDispatch, useSelector } from "react-redux";
4 | import { connect } from "./redux/blockchain/blockchainActions";
5 | import { fetchData } from "./redux/data/dataActions";
6 | import * as s from "./styles/globalStyles";
7 | import LipRenderer from "./components/lipRenderer";
8 | import _color from "./assets/images/bg/_color.png";
9 |
10 | function App() {
11 | const dispatch = useDispatch();
12 | const blockchain = useSelector((state) => state.blockchain);
13 | const data = useSelector((state) => state.data);
14 | const [loading, setLoading] = useState(false);
15 |
16 | console.log(data);
17 |
18 | const mintNFT = (_account, _name) => {
19 | setLoading(true);
20 | blockchain.lipToken.methods
21 | .createRandomLip(_name)
22 | .send({
23 | from: _account,
24 | value: blockchain.web3.utils.toWei("0.01", "ether"),
25 | })
26 | .once("error", (err) => {
27 | setLoading(false);
28 | console.log(err);
29 | })
30 | .then((receipt) => {
31 | setLoading(false);
32 | console.log(receipt);
33 | dispatch(fetchData(blockchain.account));
34 | });
35 | };
36 |
37 | const levelUpLip = (_account, _id) => {
38 | setLoading(true);
39 | blockchain.lipToken.methods
40 | .levelUp(_id)
41 | .send({
42 | from: _account,
43 | })
44 | .once("error", (err) => {
45 | setLoading(false);
46 | console.log(err);
47 | })
48 | .then((receipt) => {
49 | setLoading(false);
50 | console.log(receipt);
51 | dispatch(fetchData(blockchain.account));
52 | });
53 | };
54 |
55 | useEffect(() => {
56 | if (blockchain.account != "" && blockchain.lipToken != null) {
57 | dispatch(fetchData(blockchain.account));
58 | }
59 | }, [blockchain.lipToken]);
60 |
61 | return (
62 |
63 | {blockchain.account === "" || blockchain.lipToken === null ? (
64 |
65 | Connect to the game
66 |
67 |
75 |
76 | {blockchain.errorMsg != "" ? (
77 | {blockchain.errorMsg}
78 | ) : null}
79 |
80 | ) : (
81 |
82 | Welcome to the game
83 |
84 |
93 |
94 |
95 | {data.allLips.map((item, index) => {
96 | return (
97 |
98 |
99 |
100 |
101 | ID: {item.id}
102 | DNA: {item.dna}
103 | LEVEL: {item.level}
104 | NAME: {item.name}
105 | RARITY: {item.rarity}
106 |
107 |
116 |
117 |
118 | );
119 | })}
120 |
121 |
122 | )}
123 |
124 | );
125 | }
126 |
127 | export default App;
128 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/src/assets/images/bg/_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/bg/_color.png
--------------------------------------------------------------------------------
/src/assets/images/parts/ad/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/ad/0.png
--------------------------------------------------------------------------------
/src/assets/images/parts/ad/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/ad/1.png
--------------------------------------------------------------------------------
/src/assets/images/parts/ad/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/ad/2.png
--------------------------------------------------------------------------------
/src/assets/images/parts/ad/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/ad/3.png
--------------------------------------------------------------------------------
/src/assets/images/parts/ad/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/ad/4.png
--------------------------------------------------------------------------------
/src/assets/images/parts/ad/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/ad/5.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am1/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am1/0.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am1/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am1/1.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am1/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am1/2.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am1/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am1/3.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am1/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am1/4.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am1/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am1/5.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am2/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am2/0.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am2/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am2/1.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am2/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am2/2.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am2/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am2/3.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am2/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am2/4.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am2/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am2/5.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am3/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am3/0.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am3/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am3/1.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am3/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am3/2.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am3/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am3/3.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am3/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am3/4.png
--------------------------------------------------------------------------------
/src/assets/images/parts/am3/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/am3/5.png
--------------------------------------------------------------------------------
/src/assets/images/parts/b/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/b/0.png
--------------------------------------------------------------------------------
/src/assets/images/parts/b/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/b/1.png
--------------------------------------------------------------------------------
/src/assets/images/parts/b/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/b/2.png
--------------------------------------------------------------------------------
/src/assets/images/parts/b/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/b/3.png
--------------------------------------------------------------------------------
/src/assets/images/parts/b/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/b/4.png
--------------------------------------------------------------------------------
/src/assets/images/parts/b/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/b/5.png
--------------------------------------------------------------------------------
/src/assets/images/parts/l/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/l/0.png
--------------------------------------------------------------------------------
/src/assets/images/parts/l/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/l/1.png
--------------------------------------------------------------------------------
/src/assets/images/parts/l/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/l/2.png
--------------------------------------------------------------------------------
/src/assets/images/parts/l/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/l/3.png
--------------------------------------------------------------------------------
/src/assets/images/parts/l/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/l/4.png
--------------------------------------------------------------------------------
/src/assets/images/parts/l/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/l/5.png
--------------------------------------------------------------------------------
/src/assets/images/parts/m/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/m/0.png
--------------------------------------------------------------------------------
/src/assets/images/parts/m/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/m/1.png
--------------------------------------------------------------------------------
/src/assets/images/parts/m/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/m/2.png
--------------------------------------------------------------------------------
/src/assets/images/parts/m/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/m/3.png
--------------------------------------------------------------------------------
/src/assets/images/parts/m/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/m/4.png
--------------------------------------------------------------------------------
/src/assets/images/parts/m/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/parts/m/5.png
--------------------------------------------------------------------------------
/src/assets/images/rarity/_rarity_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/rarity/_rarity_1.png
--------------------------------------------------------------------------------
/src/assets/images/rarity/_rarity_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/rarity/_rarity_2.png
--------------------------------------------------------------------------------
/src/assets/images/rarity/_rarity_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/rarity/_rarity_3.png
--------------------------------------------------------------------------------
/src/assets/images/wrapper/_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/wrapper/_back.png
--------------------------------------------------------------------------------
/src/assets/images/wrapper/_wrapper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HashLips/nft_game/b9da2df7bbf1c6ec0d0b7f7350b900ef2861f4ca/src/assets/images/wrapper/_wrapper.png
--------------------------------------------------------------------------------
/src/components/lipRenderer.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | // cards
3 | import { parts } from "../parts/parts";
4 | import _r1 from "../assets/images/rarity/_rarity_1.png";
5 | import _r2 from "../assets/images/rarity/_rarity_2.png";
6 | import _r3 from "../assets/images/rarity/_rarity_3.png";
7 |
8 | const LipRenderer = ({ lip = null, size = 200, style }) => {
9 | if (!lip) {
10 | return null;
11 | }
12 | let rarity = _r1;
13 |
14 | if (lip.rarity >= 80) {
15 | rarity = _r2;
16 | }
17 | if (lip.rarity >= 95) {
18 | rarity = _r3;
19 | }
20 |
21 | let dnaStr = String(lip.dna);
22 |
23 | while (dnaStr.length < 16) dnaStr = "0" + dnaStr;
24 |
25 | let lipDeatils = {
26 | bg: dnaStr.substring(0, 2) % 5,
27 | mask: dnaStr.substring(2, 4) % 5,
28 | line: dnaStr.substring(4, 6) % 5,
29 | addon: dnaStr.substring(6, 8) % 5,
30 | addonMouth1: dnaStr.substring(8, 10) % 5,
31 | addonMouth2: dnaStr.substring(10, 12) % 5,
32 | addonMouth3: dnaStr.substring(12, 14) % 5,
33 | name: lip.name,
34 | };
35 |
36 | const lipStyle = {
37 | width: "100%",
38 | height: "100%",
39 | position: "absolute",
40 | };
41 |
42 | return (
43 |
52 |

53 |

54 |

55 |

56 |

61 |

66 |

71 |

72 |
73 | );
74 | };
75 |
76 | export default LipRenderer;
77 |
--------------------------------------------------------------------------------
/src/contracts/Migrations.json:
--------------------------------------------------------------------------------
1 | {
2 | "contractName": "Migrations",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "name": "last_completed_migration",
7 | "outputs": [
8 | {
9 | "internalType": "uint256",
10 | "name": "",
11 | "type": "uint256"
12 | }
13 | ],
14 | "stateMutability": "view",
15 | "type": "function",
16 | "constant": true
17 | },
18 | {
19 | "inputs": [],
20 | "name": "owner",
21 | "outputs": [
22 | {
23 | "internalType": "address",
24 | "name": "",
25 | "type": "address"
26 | }
27 | ],
28 | "stateMutability": "view",
29 | "type": "function",
30 | "constant": true
31 | },
32 | {
33 | "inputs": [
34 | {
35 | "internalType": "uint256",
36 | "name": "completed",
37 | "type": "uint256"
38 | }
39 | ],
40 | "name": "setCompleted",
41 | "outputs": [],
42 | "stateMutability": "nonpayable",
43 | "type": "function"
44 | }
45 | ],
46 | "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/danielbotha/Desktop/nft_game/nft_game/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/danielbotha/Desktop/nft_game/nft_game/contracts/Migrations.sol\":{\"keccak256\":\"0x7eaedbb1a3e4e0f585d9063393872f88ded247ca3c3c3c8492ea18e7629a6411\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4a3eb571cee910095df65a06a1c1d3f89187c72a3c184ef87a7538d9aa39ad07\",\"dweb:/ipfs/QmdqR3vrSSGR49qFGZr49Mb39z7dgD6tSzEDoaqtM31o61\"]}},\"version\":1}",
47 | "bytecode": "0x6080604052600080546001600160a01b0319163317905534801561002257600080fd5b50610199806100326000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd57614610079575b600080fd5b61004e61008e565b60405161005b919061015a565b60405180910390f35b61006c610094565b60405161005b91906100f3565b61008c6100873660046100db565b6100a3565b005b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633146100d65760405162461bcd60e51b81526004016100cd90610107565b60405180910390fd5b600155565b6000602082840312156100ec578081fd5b5035919050565b6001600160a01b0391909116815260200190565b60208082526033908201527f546869732066756e6374696f6e206973207265737472696374656420746f207460408201527234329031b7b73a3930b1ba13b99037bbb732b960691b606082015260800190565b9081526020019056fea2646970667358221220f86407898c2a23e191fdb75e824d9d1baa363dc1ac0ddf0f6c440f3618c5d79764736f6c63430008000033",
48 | "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd57614610079575b600080fd5b61004e61008e565b60405161005b919061015a565b60405180910390f35b61006c610094565b60405161005b91906100f3565b61008c6100873660046100db565b6100a3565b005b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633146100d65760405162461bcd60e51b81526004016100cd90610107565b60405180910390fd5b600155565b6000602082840312156100ec578081fd5b5035919050565b6001600160a01b0391909116815260200190565b60208082526033908201527f546869732066756e6374696f6e206973207265737472696374656420746f207460408201527234329031b7b73a3930b1ba13b99037bbb732b960691b606082015260800190565b9081526020019056fea2646970667358221220f86407898c2a23e191fdb75e824d9d1baa363dc1ac0ddf0f6c440f3618c5d79764736f6c63430008000033",
49 | "immutableReferences": {},
50 | "generatedSources": [],
51 | "deployedGeneratedSources": [
52 | {
53 | "ast": {
54 | "nodeType": "YulBlock",
55 | "src": "0:1016:1",
56 | "statements": [
57 | {
58 | "nodeType": "YulBlock",
59 | "src": "6:3:1",
60 | "statements": []
61 | },
62 | {
63 | "body": {
64 | "nodeType": "YulBlock",
65 | "src": "84:120:1",
66 | "statements": [
67 | {
68 | "body": {
69 | "nodeType": "YulBlock",
70 | "src": "130:26:1",
71 | "statements": [
72 | {
73 | "expression": {
74 | "arguments": [
75 | {
76 | "name": "value0",
77 | "nodeType": "YulIdentifier",
78 | "src": "139:6:1"
79 | },
80 | {
81 | "name": "value0",
82 | "nodeType": "YulIdentifier",
83 | "src": "147:6:1"
84 | }
85 | ],
86 | "functionName": {
87 | "name": "revert",
88 | "nodeType": "YulIdentifier",
89 | "src": "132:6:1"
90 | },
91 | "nodeType": "YulFunctionCall",
92 | "src": "132:22:1"
93 | },
94 | "nodeType": "YulExpressionStatement",
95 | "src": "132:22:1"
96 | }
97 | ]
98 | },
99 | "condition": {
100 | "arguments": [
101 | {
102 | "arguments": [
103 | {
104 | "name": "dataEnd",
105 | "nodeType": "YulIdentifier",
106 | "src": "105:7:1"
107 | },
108 | {
109 | "name": "headStart",
110 | "nodeType": "YulIdentifier",
111 | "src": "114:9:1"
112 | }
113 | ],
114 | "functionName": {
115 | "name": "sub",
116 | "nodeType": "YulIdentifier",
117 | "src": "101:3:1"
118 | },
119 | "nodeType": "YulFunctionCall",
120 | "src": "101:23:1"
121 | },
122 | {
123 | "kind": "number",
124 | "nodeType": "YulLiteral",
125 | "src": "126:2:1",
126 | "type": "",
127 | "value": "32"
128 | }
129 | ],
130 | "functionName": {
131 | "name": "slt",
132 | "nodeType": "YulIdentifier",
133 | "src": "97:3:1"
134 | },
135 | "nodeType": "YulFunctionCall",
136 | "src": "97:32:1"
137 | },
138 | "nodeType": "YulIf",
139 | "src": "94:2:1"
140 | },
141 | {
142 | "nodeType": "YulAssignment",
143 | "src": "165:33:1",
144 | "value": {
145 | "arguments": [
146 | {
147 | "name": "headStart",
148 | "nodeType": "YulIdentifier",
149 | "src": "188:9:1"
150 | }
151 | ],
152 | "functionName": {
153 | "name": "calldataload",
154 | "nodeType": "YulIdentifier",
155 | "src": "175:12:1"
156 | },
157 | "nodeType": "YulFunctionCall",
158 | "src": "175:23:1"
159 | },
160 | "variableNames": [
161 | {
162 | "name": "value0",
163 | "nodeType": "YulIdentifier",
164 | "src": "165:6:1"
165 | }
166 | ]
167 | }
168 | ]
169 | },
170 | "name": "abi_decode_tuple_t_uint256",
171 | "nodeType": "YulFunctionDefinition",
172 | "parameters": [
173 | {
174 | "name": "headStart",
175 | "nodeType": "YulTypedName",
176 | "src": "50:9:1",
177 | "type": ""
178 | },
179 | {
180 | "name": "dataEnd",
181 | "nodeType": "YulTypedName",
182 | "src": "61:7:1",
183 | "type": ""
184 | }
185 | ],
186 | "returnVariables": [
187 | {
188 | "name": "value0",
189 | "nodeType": "YulTypedName",
190 | "src": "73:6:1",
191 | "type": ""
192 | }
193 | ],
194 | "src": "14:190:1"
195 | },
196 | {
197 | "body": {
198 | "nodeType": "YulBlock",
199 | "src": "310:102:1",
200 | "statements": [
201 | {
202 | "nodeType": "YulAssignment",
203 | "src": "320:26:1",
204 | "value": {
205 | "arguments": [
206 | {
207 | "name": "headStart",
208 | "nodeType": "YulIdentifier",
209 | "src": "332:9:1"
210 | },
211 | {
212 | "kind": "number",
213 | "nodeType": "YulLiteral",
214 | "src": "343:2:1",
215 | "type": "",
216 | "value": "32"
217 | }
218 | ],
219 | "functionName": {
220 | "name": "add",
221 | "nodeType": "YulIdentifier",
222 | "src": "328:3:1"
223 | },
224 | "nodeType": "YulFunctionCall",
225 | "src": "328:18:1"
226 | },
227 | "variableNames": [
228 | {
229 | "name": "tail",
230 | "nodeType": "YulIdentifier",
231 | "src": "320:4:1"
232 | }
233 | ]
234 | },
235 | {
236 | "expression": {
237 | "arguments": [
238 | {
239 | "name": "headStart",
240 | "nodeType": "YulIdentifier",
241 | "src": "362:9:1"
242 | },
243 | {
244 | "arguments": [
245 | {
246 | "name": "value0",
247 | "nodeType": "YulIdentifier",
248 | "src": "377:6:1"
249 | },
250 | {
251 | "arguments": [
252 | {
253 | "arguments": [
254 | {
255 | "kind": "number",
256 | "nodeType": "YulLiteral",
257 | "src": "393:3:1",
258 | "type": "",
259 | "value": "160"
260 | },
261 | {
262 | "kind": "number",
263 | "nodeType": "YulLiteral",
264 | "src": "398:1:1",
265 | "type": "",
266 | "value": "1"
267 | }
268 | ],
269 | "functionName": {
270 | "name": "shl",
271 | "nodeType": "YulIdentifier",
272 | "src": "389:3:1"
273 | },
274 | "nodeType": "YulFunctionCall",
275 | "src": "389:11:1"
276 | },
277 | {
278 | "kind": "number",
279 | "nodeType": "YulLiteral",
280 | "src": "402:1:1",
281 | "type": "",
282 | "value": "1"
283 | }
284 | ],
285 | "functionName": {
286 | "name": "sub",
287 | "nodeType": "YulIdentifier",
288 | "src": "385:3:1"
289 | },
290 | "nodeType": "YulFunctionCall",
291 | "src": "385:19:1"
292 | }
293 | ],
294 | "functionName": {
295 | "name": "and",
296 | "nodeType": "YulIdentifier",
297 | "src": "373:3:1"
298 | },
299 | "nodeType": "YulFunctionCall",
300 | "src": "373:32:1"
301 | }
302 | ],
303 | "functionName": {
304 | "name": "mstore",
305 | "nodeType": "YulIdentifier",
306 | "src": "355:6:1"
307 | },
308 | "nodeType": "YulFunctionCall",
309 | "src": "355:51:1"
310 | },
311 | "nodeType": "YulExpressionStatement",
312 | "src": "355:51:1"
313 | }
314 | ]
315 | },
316 | "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed",
317 | "nodeType": "YulFunctionDefinition",
318 | "parameters": [
319 | {
320 | "name": "headStart",
321 | "nodeType": "YulTypedName",
322 | "src": "279:9:1",
323 | "type": ""
324 | },
325 | {
326 | "name": "value0",
327 | "nodeType": "YulTypedName",
328 | "src": "290:6:1",
329 | "type": ""
330 | }
331 | ],
332 | "returnVariables": [
333 | {
334 | "name": "tail",
335 | "nodeType": "YulTypedName",
336 | "src": "301:4:1",
337 | "type": ""
338 | }
339 | ],
340 | "src": "209:203:1"
341 | },
342 | {
343 | "body": {
344 | "nodeType": "YulBlock",
345 | "src": "591:241:1",
346 | "statements": [
347 | {
348 | "expression": {
349 | "arguments": [
350 | {
351 | "name": "headStart",
352 | "nodeType": "YulIdentifier",
353 | "src": "608:9:1"
354 | },
355 | {
356 | "kind": "number",
357 | "nodeType": "YulLiteral",
358 | "src": "619:2:1",
359 | "type": "",
360 | "value": "32"
361 | }
362 | ],
363 | "functionName": {
364 | "name": "mstore",
365 | "nodeType": "YulIdentifier",
366 | "src": "601:6:1"
367 | },
368 | "nodeType": "YulFunctionCall",
369 | "src": "601:21:1"
370 | },
371 | "nodeType": "YulExpressionStatement",
372 | "src": "601:21:1"
373 | },
374 | {
375 | "expression": {
376 | "arguments": [
377 | {
378 | "arguments": [
379 | {
380 | "name": "headStart",
381 | "nodeType": "YulIdentifier",
382 | "src": "642:9:1"
383 | },
384 | {
385 | "kind": "number",
386 | "nodeType": "YulLiteral",
387 | "src": "653:2:1",
388 | "type": "",
389 | "value": "32"
390 | }
391 | ],
392 | "functionName": {
393 | "name": "add",
394 | "nodeType": "YulIdentifier",
395 | "src": "638:3:1"
396 | },
397 | "nodeType": "YulFunctionCall",
398 | "src": "638:18:1"
399 | },
400 | {
401 | "kind": "number",
402 | "nodeType": "YulLiteral",
403 | "src": "658:2:1",
404 | "type": "",
405 | "value": "51"
406 | }
407 | ],
408 | "functionName": {
409 | "name": "mstore",
410 | "nodeType": "YulIdentifier",
411 | "src": "631:6:1"
412 | },
413 | "nodeType": "YulFunctionCall",
414 | "src": "631:30:1"
415 | },
416 | "nodeType": "YulExpressionStatement",
417 | "src": "631:30:1"
418 | },
419 | {
420 | "expression": {
421 | "arguments": [
422 | {
423 | "arguments": [
424 | {
425 | "name": "headStart",
426 | "nodeType": "YulIdentifier",
427 | "src": "681:9:1"
428 | },
429 | {
430 | "kind": "number",
431 | "nodeType": "YulLiteral",
432 | "src": "692:2:1",
433 | "type": "",
434 | "value": "64"
435 | }
436 | ],
437 | "functionName": {
438 | "name": "add",
439 | "nodeType": "YulIdentifier",
440 | "src": "677:3:1"
441 | },
442 | "nodeType": "YulFunctionCall",
443 | "src": "677:18:1"
444 | },
445 | {
446 | "kind": "string",
447 | "nodeType": "YulLiteral",
448 | "src": "697:34:1",
449 | "type": "",
450 | "value": "This function is restricted to t"
451 | }
452 | ],
453 | "functionName": {
454 | "name": "mstore",
455 | "nodeType": "YulIdentifier",
456 | "src": "670:6:1"
457 | },
458 | "nodeType": "YulFunctionCall",
459 | "src": "670:62:1"
460 | },
461 | "nodeType": "YulExpressionStatement",
462 | "src": "670:62:1"
463 | },
464 | {
465 | "expression": {
466 | "arguments": [
467 | {
468 | "arguments": [
469 | {
470 | "name": "headStart",
471 | "nodeType": "YulIdentifier",
472 | "src": "752:9:1"
473 | },
474 | {
475 | "kind": "number",
476 | "nodeType": "YulLiteral",
477 | "src": "763:2:1",
478 | "type": "",
479 | "value": "96"
480 | }
481 | ],
482 | "functionName": {
483 | "name": "add",
484 | "nodeType": "YulIdentifier",
485 | "src": "748:3:1"
486 | },
487 | "nodeType": "YulFunctionCall",
488 | "src": "748:18:1"
489 | },
490 | {
491 | "kind": "string",
492 | "nodeType": "YulLiteral",
493 | "src": "768:21:1",
494 | "type": "",
495 | "value": "he contract's owner"
496 | }
497 | ],
498 | "functionName": {
499 | "name": "mstore",
500 | "nodeType": "YulIdentifier",
501 | "src": "741:6:1"
502 | },
503 | "nodeType": "YulFunctionCall",
504 | "src": "741:49:1"
505 | },
506 | "nodeType": "YulExpressionStatement",
507 | "src": "741:49:1"
508 | },
509 | {
510 | "nodeType": "YulAssignment",
511 | "src": "799:27:1",
512 | "value": {
513 | "arguments": [
514 | {
515 | "name": "headStart",
516 | "nodeType": "YulIdentifier",
517 | "src": "811:9:1"
518 | },
519 | {
520 | "kind": "number",
521 | "nodeType": "YulLiteral",
522 | "src": "822:3:1",
523 | "type": "",
524 | "value": "128"
525 | }
526 | ],
527 | "functionName": {
528 | "name": "add",
529 | "nodeType": "YulIdentifier",
530 | "src": "807:3:1"
531 | },
532 | "nodeType": "YulFunctionCall",
533 | "src": "807:19:1"
534 | },
535 | "variableNames": [
536 | {
537 | "name": "tail",
538 | "nodeType": "YulIdentifier",
539 | "src": "799:4:1"
540 | }
541 | ]
542 | }
543 | ]
544 | },
545 | "name": "abi_encode_tuple_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1__to_t_string_memory_ptr__fromStack_reversed",
546 | "nodeType": "YulFunctionDefinition",
547 | "parameters": [
548 | {
549 | "name": "headStart",
550 | "nodeType": "YulTypedName",
551 | "src": "568:9:1",
552 | "type": ""
553 | }
554 | ],
555 | "returnVariables": [
556 | {
557 | "name": "tail",
558 | "nodeType": "YulTypedName",
559 | "src": "582:4:1",
560 | "type": ""
561 | }
562 | ],
563 | "src": "417:415:1"
564 | },
565 | {
566 | "body": {
567 | "nodeType": "YulBlock",
568 | "src": "938:76:1",
569 | "statements": [
570 | {
571 | "nodeType": "YulAssignment",
572 | "src": "948:26:1",
573 | "value": {
574 | "arguments": [
575 | {
576 | "name": "headStart",
577 | "nodeType": "YulIdentifier",
578 | "src": "960:9:1"
579 | },
580 | {
581 | "kind": "number",
582 | "nodeType": "YulLiteral",
583 | "src": "971:2:1",
584 | "type": "",
585 | "value": "32"
586 | }
587 | ],
588 | "functionName": {
589 | "name": "add",
590 | "nodeType": "YulIdentifier",
591 | "src": "956:3:1"
592 | },
593 | "nodeType": "YulFunctionCall",
594 | "src": "956:18:1"
595 | },
596 | "variableNames": [
597 | {
598 | "name": "tail",
599 | "nodeType": "YulIdentifier",
600 | "src": "948:4:1"
601 | }
602 | ]
603 | },
604 | {
605 | "expression": {
606 | "arguments": [
607 | {
608 | "name": "headStart",
609 | "nodeType": "YulIdentifier",
610 | "src": "990:9:1"
611 | },
612 | {
613 | "name": "value0",
614 | "nodeType": "YulIdentifier",
615 | "src": "1001:6:1"
616 | }
617 | ],
618 | "functionName": {
619 | "name": "mstore",
620 | "nodeType": "YulIdentifier",
621 | "src": "983:6:1"
622 | },
623 | "nodeType": "YulFunctionCall",
624 | "src": "983:25:1"
625 | },
626 | "nodeType": "YulExpressionStatement",
627 | "src": "983:25:1"
628 | }
629 | ]
630 | },
631 | "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
632 | "nodeType": "YulFunctionDefinition",
633 | "parameters": [
634 | {
635 | "name": "headStart",
636 | "nodeType": "YulTypedName",
637 | "src": "907:9:1",
638 | "type": ""
639 | },
640 | {
641 | "name": "value0",
642 | "nodeType": "YulTypedName",
643 | "src": "918:6:1",
644 | "type": ""
645 | }
646 | ],
647 | "returnVariables": [
648 | {
649 | "name": "tail",
650 | "nodeType": "YulTypedName",
651 | "src": "929:4:1",
652 | "type": ""
653 | }
654 | ],
655 | "src": "837:177:1"
656 | }
657 | ]
658 | },
659 | "contents": "{\n { }\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(value0, value0) }\n value0 := calldataload(headStart)\n }\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 51)\n mstore(add(headStart, 64), \"This function is restricted to t\")\n mstore(add(headStart, 96), \"he contract's owner\")\n tail := add(headStart, 128)\n }\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n}",
660 | "id": 1,
661 | "language": "Yul",
662 | "name": "#utility.yul"
663 | }
664 | ],
665 | "sourceMap": "66:352:0:-:0;;;90:33;;;-1:-1:-1;;;;;;90:33:0;113:10;90:33;;;66:352;;;;;;;;;;;;;;;;",
666 | "deployedSourceMap": "66:352:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;127:36;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;90:33;;;:::i;:::-;;;;;;;:::i;313:103::-;;;;;;:::i;:::-;;:::i;:::-;;127:36;;;;:::o;90:33::-;;;-1:-1:-1;;;;;90:33:0;;:::o;313:103::-;225:5;;-1:-1:-1;;;;;225:5:0;211:10;:19;196:101;;;;-1:-1:-1;;;196:101:0;;;;;;;:::i;:::-;;;;;;;;;375:24:::1;:36:::0;313:103::o;14:190:1:-;;126:2;114:9;105:7;101:23;97:32;94:2;;;147:6;139;132:22;94:2;-1:-1:-1;175:23:1;;84:120;-1:-1:-1;84:120:1:o;209:203::-;-1:-1:-1;;;;;373:32:1;;;;355:51;;343:2;328:18;;310:102::o;417:415::-;619:2;601:21;;;658:2;638:18;;;631:30;697:34;692:2;677:18;;670:62;-1:-1:-1;;;763:2:1;748:18;;741:49;822:3;807:19;;591:241::o;837:177::-;983:25;;;971:2;956:18;;938:76::o",
667 | "source": "// SPDX-License-Identifier: MIT\npragma solidity >=0.4.22 <0.9.0;\n\ncontract Migrations {\n address public owner = msg.sender;\n uint public last_completed_migration;\n\n modifier restricted() {\n require(\n msg.sender == owner,\n \"This function is restricted to the contract's owner\"\n );\n _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n}\n",
668 | "sourcePath": "/Users/danielbotha/Desktop/nft_game/nft_game/contracts/Migrations.sol",
669 | "ast": {
670 | "absolutePath": "/Users/danielbotha/Desktop/nft_game/nft_game/contracts/Migrations.sol",
671 | "exportedSymbols": {
672 | "Migrations": [
673 | 32
674 | ]
675 | },
676 | "id": 33,
677 | "license": "MIT",
678 | "nodeType": "SourceUnit",
679 | "nodes": [
680 | {
681 | "id": 1,
682 | "literals": [
683 | "solidity",
684 | ">=",
685 | "0.4",
686 | ".22",
687 | "<",
688 | "0.9",
689 | ".0"
690 | ],
691 | "nodeType": "PragmaDirective",
692 | "src": "32:32:0"
693 | },
694 | {
695 | "abstract": false,
696 | "baseContracts": [],
697 | "contractDependencies": [],
698 | "contractKind": "contract",
699 | "fullyImplemented": true,
700 | "id": 32,
701 | "linearizedBaseContracts": [
702 | 32
703 | ],
704 | "name": "Migrations",
705 | "nodeType": "ContractDefinition",
706 | "nodes": [
707 | {
708 | "constant": false,
709 | "functionSelector": "8da5cb5b",
710 | "id": 5,
711 | "mutability": "mutable",
712 | "name": "owner",
713 | "nodeType": "VariableDeclaration",
714 | "scope": 32,
715 | "src": "90:33:0",
716 | "stateVariable": true,
717 | "storageLocation": "default",
718 | "typeDescriptions": {
719 | "typeIdentifier": "t_address",
720 | "typeString": "address"
721 | },
722 | "typeName": {
723 | "id": 2,
724 | "name": "address",
725 | "nodeType": "ElementaryTypeName",
726 | "src": "90:7:0",
727 | "stateMutability": "nonpayable",
728 | "typeDescriptions": {
729 | "typeIdentifier": "t_address",
730 | "typeString": "address"
731 | }
732 | },
733 | "value": {
734 | "expression": {
735 | "id": 3,
736 | "name": "msg",
737 | "nodeType": "Identifier",
738 | "overloadedDeclarations": [],
739 | "referencedDeclaration": 4294967281,
740 | "src": "113:3:0",
741 | "typeDescriptions": {
742 | "typeIdentifier": "t_magic_message",
743 | "typeString": "msg"
744 | }
745 | },
746 | "id": 4,
747 | "isConstant": false,
748 | "isLValue": false,
749 | "isPure": false,
750 | "lValueRequested": false,
751 | "memberName": "sender",
752 | "nodeType": "MemberAccess",
753 | "src": "113:10:0",
754 | "typeDescriptions": {
755 | "typeIdentifier": "t_address",
756 | "typeString": "address"
757 | }
758 | },
759 | "visibility": "public"
760 | },
761 | {
762 | "constant": false,
763 | "functionSelector": "445df0ac",
764 | "id": 7,
765 | "mutability": "mutable",
766 | "name": "last_completed_migration",
767 | "nodeType": "VariableDeclaration",
768 | "scope": 32,
769 | "src": "127:36:0",
770 | "stateVariable": true,
771 | "storageLocation": "default",
772 | "typeDescriptions": {
773 | "typeIdentifier": "t_uint256",
774 | "typeString": "uint256"
775 | },
776 | "typeName": {
777 | "id": 6,
778 | "name": "uint",
779 | "nodeType": "ElementaryTypeName",
780 | "src": "127:4:0",
781 | "typeDescriptions": {
782 | "typeIdentifier": "t_uint256",
783 | "typeString": "uint256"
784 | }
785 | },
786 | "visibility": "public"
787 | },
788 | {
789 | "body": {
790 | "id": 18,
791 | "nodeType": "Block",
792 | "src": "190:119:0",
793 | "statements": [
794 | {
795 | "expression": {
796 | "arguments": [
797 | {
798 | "commonType": {
799 | "typeIdentifier": "t_address",
800 | "typeString": "address"
801 | },
802 | "id": 13,
803 | "isConstant": false,
804 | "isLValue": false,
805 | "isPure": false,
806 | "lValueRequested": false,
807 | "leftExpression": {
808 | "expression": {
809 | "id": 10,
810 | "name": "msg",
811 | "nodeType": "Identifier",
812 | "overloadedDeclarations": [],
813 | "referencedDeclaration": 4294967281,
814 | "src": "211:3:0",
815 | "typeDescriptions": {
816 | "typeIdentifier": "t_magic_message",
817 | "typeString": "msg"
818 | }
819 | },
820 | "id": 11,
821 | "isConstant": false,
822 | "isLValue": false,
823 | "isPure": false,
824 | "lValueRequested": false,
825 | "memberName": "sender",
826 | "nodeType": "MemberAccess",
827 | "src": "211:10:0",
828 | "typeDescriptions": {
829 | "typeIdentifier": "t_address",
830 | "typeString": "address"
831 | }
832 | },
833 | "nodeType": "BinaryOperation",
834 | "operator": "==",
835 | "rightExpression": {
836 | "id": 12,
837 | "name": "owner",
838 | "nodeType": "Identifier",
839 | "overloadedDeclarations": [],
840 | "referencedDeclaration": 5,
841 | "src": "225:5:0",
842 | "typeDescriptions": {
843 | "typeIdentifier": "t_address",
844 | "typeString": "address"
845 | }
846 | },
847 | "src": "211:19:0",
848 | "typeDescriptions": {
849 | "typeIdentifier": "t_bool",
850 | "typeString": "bool"
851 | }
852 | },
853 | {
854 | "hexValue": "546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572",
855 | "id": 14,
856 | "isConstant": false,
857 | "isLValue": false,
858 | "isPure": true,
859 | "kind": "string",
860 | "lValueRequested": false,
861 | "nodeType": "Literal",
862 | "src": "238:53:0",
863 | "typeDescriptions": {
864 | "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1",
865 | "typeString": "literal_string \"This function is restricted to the contract's owner\""
866 | },
867 | "value": "This function is restricted to the contract's owner"
868 | }
869 | ],
870 | "expression": {
871 | "argumentTypes": [
872 | {
873 | "typeIdentifier": "t_bool",
874 | "typeString": "bool"
875 | },
876 | {
877 | "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1",
878 | "typeString": "literal_string \"This function is restricted to the contract's owner\""
879 | }
880 | ],
881 | "id": 9,
882 | "name": "require",
883 | "nodeType": "Identifier",
884 | "overloadedDeclarations": [
885 | 4294967278,
886 | 4294967278
887 | ],
888 | "referencedDeclaration": 4294967278,
889 | "src": "196:7:0",
890 | "typeDescriptions": {
891 | "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
892 | "typeString": "function (bool,string memory) pure"
893 | }
894 | },
895 | "id": 15,
896 | "isConstant": false,
897 | "isLValue": false,
898 | "isPure": false,
899 | "kind": "functionCall",
900 | "lValueRequested": false,
901 | "names": [],
902 | "nodeType": "FunctionCall",
903 | "src": "196:101:0",
904 | "tryCall": false,
905 | "typeDescriptions": {
906 | "typeIdentifier": "t_tuple$__$",
907 | "typeString": "tuple()"
908 | }
909 | },
910 | "id": 16,
911 | "nodeType": "ExpressionStatement",
912 | "src": "196:101:0"
913 | },
914 | {
915 | "id": 17,
916 | "nodeType": "PlaceholderStatement",
917 | "src": "303:1:0"
918 | }
919 | ]
920 | },
921 | "id": 19,
922 | "name": "restricted",
923 | "nodeType": "ModifierDefinition",
924 | "parameters": {
925 | "id": 8,
926 | "nodeType": "ParameterList",
927 | "parameters": [],
928 | "src": "187:2:0"
929 | },
930 | "src": "168:141:0",
931 | "virtual": false,
932 | "visibility": "internal"
933 | },
934 | {
935 | "body": {
936 | "id": 30,
937 | "nodeType": "Block",
938 | "src": "369:47:0",
939 | "statements": [
940 | {
941 | "expression": {
942 | "id": 28,
943 | "isConstant": false,
944 | "isLValue": false,
945 | "isPure": false,
946 | "lValueRequested": false,
947 | "leftHandSide": {
948 | "id": 26,
949 | "name": "last_completed_migration",
950 | "nodeType": "Identifier",
951 | "overloadedDeclarations": [],
952 | "referencedDeclaration": 7,
953 | "src": "375:24:0",
954 | "typeDescriptions": {
955 | "typeIdentifier": "t_uint256",
956 | "typeString": "uint256"
957 | }
958 | },
959 | "nodeType": "Assignment",
960 | "operator": "=",
961 | "rightHandSide": {
962 | "id": 27,
963 | "name": "completed",
964 | "nodeType": "Identifier",
965 | "overloadedDeclarations": [],
966 | "referencedDeclaration": 21,
967 | "src": "402:9:0",
968 | "typeDescriptions": {
969 | "typeIdentifier": "t_uint256",
970 | "typeString": "uint256"
971 | }
972 | },
973 | "src": "375:36:0",
974 | "typeDescriptions": {
975 | "typeIdentifier": "t_uint256",
976 | "typeString": "uint256"
977 | }
978 | },
979 | "id": 29,
980 | "nodeType": "ExpressionStatement",
981 | "src": "375:36:0"
982 | }
983 | ]
984 | },
985 | "functionSelector": "fdacd576",
986 | "id": 31,
987 | "implemented": true,
988 | "kind": "function",
989 | "modifiers": [
990 | {
991 | "id": 24,
992 | "modifierName": {
993 | "id": 23,
994 | "name": "restricted",
995 | "nodeType": "IdentifierPath",
996 | "referencedDeclaration": 19,
997 | "src": "358:10:0"
998 | },
999 | "nodeType": "ModifierInvocation",
1000 | "src": "358:10:0"
1001 | }
1002 | ],
1003 | "name": "setCompleted",
1004 | "nodeType": "FunctionDefinition",
1005 | "parameters": {
1006 | "id": 22,
1007 | "nodeType": "ParameterList",
1008 | "parameters": [
1009 | {
1010 | "constant": false,
1011 | "id": 21,
1012 | "mutability": "mutable",
1013 | "name": "completed",
1014 | "nodeType": "VariableDeclaration",
1015 | "scope": 31,
1016 | "src": "335:14:0",
1017 | "stateVariable": false,
1018 | "storageLocation": "default",
1019 | "typeDescriptions": {
1020 | "typeIdentifier": "t_uint256",
1021 | "typeString": "uint256"
1022 | },
1023 | "typeName": {
1024 | "id": 20,
1025 | "name": "uint",
1026 | "nodeType": "ElementaryTypeName",
1027 | "src": "335:4:0",
1028 | "typeDescriptions": {
1029 | "typeIdentifier": "t_uint256",
1030 | "typeString": "uint256"
1031 | }
1032 | },
1033 | "visibility": "internal"
1034 | }
1035 | ],
1036 | "src": "334:16:0"
1037 | },
1038 | "returnParameters": {
1039 | "id": 25,
1040 | "nodeType": "ParameterList",
1041 | "parameters": [],
1042 | "src": "369:0:0"
1043 | },
1044 | "scope": 32,
1045 | "src": "313:103:0",
1046 | "stateMutability": "nonpayable",
1047 | "virtual": false,
1048 | "visibility": "public"
1049 | }
1050 | ],
1051 | "scope": 33,
1052 | "src": "66:352:0"
1053 | }
1054 | ],
1055 | "src": "32:387:0"
1056 | },
1057 | "legacyAST": {
1058 | "absolutePath": "/Users/danielbotha/Desktop/nft_game/nft_game/contracts/Migrations.sol",
1059 | "exportedSymbols": {
1060 | "Migrations": [
1061 | 32
1062 | ]
1063 | },
1064 | "id": 33,
1065 | "license": "MIT",
1066 | "nodeType": "SourceUnit",
1067 | "nodes": [
1068 | {
1069 | "id": 1,
1070 | "literals": [
1071 | "solidity",
1072 | ">=",
1073 | "0.4",
1074 | ".22",
1075 | "<",
1076 | "0.9",
1077 | ".0"
1078 | ],
1079 | "nodeType": "PragmaDirective",
1080 | "src": "32:32:0"
1081 | },
1082 | {
1083 | "abstract": false,
1084 | "baseContracts": [],
1085 | "contractDependencies": [],
1086 | "contractKind": "contract",
1087 | "fullyImplemented": true,
1088 | "id": 32,
1089 | "linearizedBaseContracts": [
1090 | 32
1091 | ],
1092 | "name": "Migrations",
1093 | "nodeType": "ContractDefinition",
1094 | "nodes": [
1095 | {
1096 | "constant": false,
1097 | "functionSelector": "8da5cb5b",
1098 | "id": 5,
1099 | "mutability": "mutable",
1100 | "name": "owner",
1101 | "nodeType": "VariableDeclaration",
1102 | "scope": 32,
1103 | "src": "90:33:0",
1104 | "stateVariable": true,
1105 | "storageLocation": "default",
1106 | "typeDescriptions": {
1107 | "typeIdentifier": "t_address",
1108 | "typeString": "address"
1109 | },
1110 | "typeName": {
1111 | "id": 2,
1112 | "name": "address",
1113 | "nodeType": "ElementaryTypeName",
1114 | "src": "90:7:0",
1115 | "stateMutability": "nonpayable",
1116 | "typeDescriptions": {
1117 | "typeIdentifier": "t_address",
1118 | "typeString": "address"
1119 | }
1120 | },
1121 | "value": {
1122 | "expression": {
1123 | "id": 3,
1124 | "name": "msg",
1125 | "nodeType": "Identifier",
1126 | "overloadedDeclarations": [],
1127 | "referencedDeclaration": 4294967281,
1128 | "src": "113:3:0",
1129 | "typeDescriptions": {
1130 | "typeIdentifier": "t_magic_message",
1131 | "typeString": "msg"
1132 | }
1133 | },
1134 | "id": 4,
1135 | "isConstant": false,
1136 | "isLValue": false,
1137 | "isPure": false,
1138 | "lValueRequested": false,
1139 | "memberName": "sender",
1140 | "nodeType": "MemberAccess",
1141 | "src": "113:10:0",
1142 | "typeDescriptions": {
1143 | "typeIdentifier": "t_address",
1144 | "typeString": "address"
1145 | }
1146 | },
1147 | "visibility": "public"
1148 | },
1149 | {
1150 | "constant": false,
1151 | "functionSelector": "445df0ac",
1152 | "id": 7,
1153 | "mutability": "mutable",
1154 | "name": "last_completed_migration",
1155 | "nodeType": "VariableDeclaration",
1156 | "scope": 32,
1157 | "src": "127:36:0",
1158 | "stateVariable": true,
1159 | "storageLocation": "default",
1160 | "typeDescriptions": {
1161 | "typeIdentifier": "t_uint256",
1162 | "typeString": "uint256"
1163 | },
1164 | "typeName": {
1165 | "id": 6,
1166 | "name": "uint",
1167 | "nodeType": "ElementaryTypeName",
1168 | "src": "127:4:0",
1169 | "typeDescriptions": {
1170 | "typeIdentifier": "t_uint256",
1171 | "typeString": "uint256"
1172 | }
1173 | },
1174 | "visibility": "public"
1175 | },
1176 | {
1177 | "body": {
1178 | "id": 18,
1179 | "nodeType": "Block",
1180 | "src": "190:119:0",
1181 | "statements": [
1182 | {
1183 | "expression": {
1184 | "arguments": [
1185 | {
1186 | "commonType": {
1187 | "typeIdentifier": "t_address",
1188 | "typeString": "address"
1189 | },
1190 | "id": 13,
1191 | "isConstant": false,
1192 | "isLValue": false,
1193 | "isPure": false,
1194 | "lValueRequested": false,
1195 | "leftExpression": {
1196 | "expression": {
1197 | "id": 10,
1198 | "name": "msg",
1199 | "nodeType": "Identifier",
1200 | "overloadedDeclarations": [],
1201 | "referencedDeclaration": 4294967281,
1202 | "src": "211:3:0",
1203 | "typeDescriptions": {
1204 | "typeIdentifier": "t_magic_message",
1205 | "typeString": "msg"
1206 | }
1207 | },
1208 | "id": 11,
1209 | "isConstant": false,
1210 | "isLValue": false,
1211 | "isPure": false,
1212 | "lValueRequested": false,
1213 | "memberName": "sender",
1214 | "nodeType": "MemberAccess",
1215 | "src": "211:10:0",
1216 | "typeDescriptions": {
1217 | "typeIdentifier": "t_address",
1218 | "typeString": "address"
1219 | }
1220 | },
1221 | "nodeType": "BinaryOperation",
1222 | "operator": "==",
1223 | "rightExpression": {
1224 | "id": 12,
1225 | "name": "owner",
1226 | "nodeType": "Identifier",
1227 | "overloadedDeclarations": [],
1228 | "referencedDeclaration": 5,
1229 | "src": "225:5:0",
1230 | "typeDescriptions": {
1231 | "typeIdentifier": "t_address",
1232 | "typeString": "address"
1233 | }
1234 | },
1235 | "src": "211:19:0",
1236 | "typeDescriptions": {
1237 | "typeIdentifier": "t_bool",
1238 | "typeString": "bool"
1239 | }
1240 | },
1241 | {
1242 | "hexValue": "546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572",
1243 | "id": 14,
1244 | "isConstant": false,
1245 | "isLValue": false,
1246 | "isPure": true,
1247 | "kind": "string",
1248 | "lValueRequested": false,
1249 | "nodeType": "Literal",
1250 | "src": "238:53:0",
1251 | "typeDescriptions": {
1252 | "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1",
1253 | "typeString": "literal_string \"This function is restricted to the contract's owner\""
1254 | },
1255 | "value": "This function is restricted to the contract's owner"
1256 | }
1257 | ],
1258 | "expression": {
1259 | "argumentTypes": [
1260 | {
1261 | "typeIdentifier": "t_bool",
1262 | "typeString": "bool"
1263 | },
1264 | {
1265 | "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1",
1266 | "typeString": "literal_string \"This function is restricted to the contract's owner\""
1267 | }
1268 | ],
1269 | "id": 9,
1270 | "name": "require",
1271 | "nodeType": "Identifier",
1272 | "overloadedDeclarations": [
1273 | 4294967278,
1274 | 4294967278
1275 | ],
1276 | "referencedDeclaration": 4294967278,
1277 | "src": "196:7:0",
1278 | "typeDescriptions": {
1279 | "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
1280 | "typeString": "function (bool,string memory) pure"
1281 | }
1282 | },
1283 | "id": 15,
1284 | "isConstant": false,
1285 | "isLValue": false,
1286 | "isPure": false,
1287 | "kind": "functionCall",
1288 | "lValueRequested": false,
1289 | "names": [],
1290 | "nodeType": "FunctionCall",
1291 | "src": "196:101:0",
1292 | "tryCall": false,
1293 | "typeDescriptions": {
1294 | "typeIdentifier": "t_tuple$__$",
1295 | "typeString": "tuple()"
1296 | }
1297 | },
1298 | "id": 16,
1299 | "nodeType": "ExpressionStatement",
1300 | "src": "196:101:0"
1301 | },
1302 | {
1303 | "id": 17,
1304 | "nodeType": "PlaceholderStatement",
1305 | "src": "303:1:0"
1306 | }
1307 | ]
1308 | },
1309 | "id": 19,
1310 | "name": "restricted",
1311 | "nodeType": "ModifierDefinition",
1312 | "parameters": {
1313 | "id": 8,
1314 | "nodeType": "ParameterList",
1315 | "parameters": [],
1316 | "src": "187:2:0"
1317 | },
1318 | "src": "168:141:0",
1319 | "virtual": false,
1320 | "visibility": "internal"
1321 | },
1322 | {
1323 | "body": {
1324 | "id": 30,
1325 | "nodeType": "Block",
1326 | "src": "369:47:0",
1327 | "statements": [
1328 | {
1329 | "expression": {
1330 | "id": 28,
1331 | "isConstant": false,
1332 | "isLValue": false,
1333 | "isPure": false,
1334 | "lValueRequested": false,
1335 | "leftHandSide": {
1336 | "id": 26,
1337 | "name": "last_completed_migration",
1338 | "nodeType": "Identifier",
1339 | "overloadedDeclarations": [],
1340 | "referencedDeclaration": 7,
1341 | "src": "375:24:0",
1342 | "typeDescriptions": {
1343 | "typeIdentifier": "t_uint256",
1344 | "typeString": "uint256"
1345 | }
1346 | },
1347 | "nodeType": "Assignment",
1348 | "operator": "=",
1349 | "rightHandSide": {
1350 | "id": 27,
1351 | "name": "completed",
1352 | "nodeType": "Identifier",
1353 | "overloadedDeclarations": [],
1354 | "referencedDeclaration": 21,
1355 | "src": "402:9:0",
1356 | "typeDescriptions": {
1357 | "typeIdentifier": "t_uint256",
1358 | "typeString": "uint256"
1359 | }
1360 | },
1361 | "src": "375:36:0",
1362 | "typeDescriptions": {
1363 | "typeIdentifier": "t_uint256",
1364 | "typeString": "uint256"
1365 | }
1366 | },
1367 | "id": 29,
1368 | "nodeType": "ExpressionStatement",
1369 | "src": "375:36:0"
1370 | }
1371 | ]
1372 | },
1373 | "functionSelector": "fdacd576",
1374 | "id": 31,
1375 | "implemented": true,
1376 | "kind": "function",
1377 | "modifiers": [
1378 | {
1379 | "id": 24,
1380 | "modifierName": {
1381 | "id": 23,
1382 | "name": "restricted",
1383 | "nodeType": "IdentifierPath",
1384 | "referencedDeclaration": 19,
1385 | "src": "358:10:0"
1386 | },
1387 | "nodeType": "ModifierInvocation",
1388 | "src": "358:10:0"
1389 | }
1390 | ],
1391 | "name": "setCompleted",
1392 | "nodeType": "FunctionDefinition",
1393 | "parameters": {
1394 | "id": 22,
1395 | "nodeType": "ParameterList",
1396 | "parameters": [
1397 | {
1398 | "constant": false,
1399 | "id": 21,
1400 | "mutability": "mutable",
1401 | "name": "completed",
1402 | "nodeType": "VariableDeclaration",
1403 | "scope": 31,
1404 | "src": "335:14:0",
1405 | "stateVariable": false,
1406 | "storageLocation": "default",
1407 | "typeDescriptions": {
1408 | "typeIdentifier": "t_uint256",
1409 | "typeString": "uint256"
1410 | },
1411 | "typeName": {
1412 | "id": 20,
1413 | "name": "uint",
1414 | "nodeType": "ElementaryTypeName",
1415 | "src": "335:4:0",
1416 | "typeDescriptions": {
1417 | "typeIdentifier": "t_uint256",
1418 | "typeString": "uint256"
1419 | }
1420 | },
1421 | "visibility": "internal"
1422 | }
1423 | ],
1424 | "src": "334:16:0"
1425 | },
1426 | "returnParameters": {
1427 | "id": 25,
1428 | "nodeType": "ParameterList",
1429 | "parameters": [],
1430 | "src": "369:0:0"
1431 | },
1432 | "scope": 32,
1433 | "src": "313:103:0",
1434 | "stateMutability": "nonpayable",
1435 | "virtual": false,
1436 | "visibility": "public"
1437 | }
1438 | ],
1439 | "scope": 33,
1440 | "src": "66:352:0"
1441 | }
1442 | ],
1443 | "src": "32:387:0"
1444 | },
1445 | "compiler": {
1446 | "name": "solc",
1447 | "version": "0.8.0+commit.c7dfd78e.Emscripten.clang"
1448 | },
1449 | "networks": {
1450 | "1628527017916": {
1451 | "events": {},
1452 | "links": {},
1453 | "address": "0xaD888d0Ade988EbEe74B8D4F39BF29a8d0fe8A8D",
1454 | "transactionHash": "0xc7cffe6ba06cb4e24b3dff75562186794e8691b301ac191b4b98448a65c9b0f9"
1455 | }
1456 | },
1457 | "schemaVersion": "3.4.1",
1458 | "updatedAt": "2021-08-09T20:54:06.956Z",
1459 | "networkType": "ethereum",
1460 | "devdoc": {
1461 | "kind": "dev",
1462 | "methods": {},
1463 | "version": 1
1464 | },
1465 | "userdoc": {
1466 | "kind": "user",
1467 | "methods": {},
1468 | "version": 1
1469 | }
1470 | }
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import "./index.css";
4 | import App from "./App";
5 | import reportWebVitals from "./reportWebVitals";
6 | import store from "./redux/store";
7 | import { Provider } from "react-redux";
8 | import "./styles/reset.css";
9 | import "./styles/theme.css";
10 |
11 | ReactDOM.render(
12 |
13 |
14 | ,
15 | document.getElementById("root")
16 | );
17 |
18 | // If you want to start measuring performance in your app, pass a function
19 | // to log results (for example: reportWebVitals(console.log))
20 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
21 | reportWebVitals();
22 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/parts/parts.js:
--------------------------------------------------------------------------------
1 | // parts
2 | import b_1 from "../assets/images/parts/b/1.png";
3 | import b_2 from "../assets/images/parts/b/2.png";
4 | import b_3 from "../assets/images/parts/b/3.png";
5 | import b_4 from "../assets/images/parts/b/4.png";
6 | import b_5 from "../assets/images/parts/b/5.png";
7 |
8 | import m_1 from "../assets/images/parts/m/1.png";
9 | import m_2 from "../assets/images/parts/m/2.png";
10 | import m_3 from "../assets/images/parts/m/3.png";
11 | import m_4 from "../assets/images/parts/m/4.png";
12 | import m_5 from "../assets/images/parts/m/5.png";
13 |
14 | import l_1 from "../assets/images/parts/l/1.png";
15 | import l_2 from "../assets/images/parts/l/2.png";
16 | import l_3 from "../assets/images/parts/l/3.png";
17 | import l_4 from "../assets/images/parts/l/4.png";
18 | import l_5 from "../assets/images/parts/l/5.png";
19 |
20 | import ad_1 from "../assets/images/parts/ad/1.png";
21 | import ad_2 from "../assets/images/parts/ad/2.png";
22 | import ad_3 from "../assets/images/parts/ad/3.png";
23 | import ad_4 from "../assets/images/parts/ad/4.png";
24 | import ad_5 from "../assets/images/parts/ad/5.png";
25 |
26 | import am1_1 from "../assets/images/parts/am1/1.png";
27 | import am1_2 from "../assets/images/parts/am1/2.png";
28 | import am1_3 from "../assets/images/parts/am1/3.png";
29 | import am1_4 from "../assets/images/parts/am1/4.png";
30 | import am1_5 from "../assets/images/parts/am1/5.png";
31 |
32 | import am2_1 from "../assets/images/parts/am2/1.png";
33 | import am2_2 from "../assets/images/parts/am2/2.png";
34 | import am2_3 from "../assets/images/parts/am2/3.png";
35 | import am2_4 from "../assets/images/parts/am2/4.png";
36 | import am2_5 from "../assets/images/parts/am2/5.png";
37 |
38 | import am3_1 from "../assets/images/parts/am3/1.png";
39 | import am3_2 from "../assets/images/parts/am3/2.png";
40 | import am3_3 from "../assets/images/parts/am3/3.png";
41 | import am3_4 from "../assets/images/parts/am3/4.png";
42 | import am3_5 from "../assets/images/parts/am3/5.png";
43 |
44 | export const parts = {
45 | bg: [b_1, b_2, b_3, b_4, b_5],
46 | mask: [m_1, m_2, m_3, m_4, m_5],
47 | line: [l_1, l_2, l_3, l_4, l_5],
48 | addon: [ad_1, ad_2, ad_3, ad_4, ad_5],
49 | addonMouth1: [am1_1, am1_2, am1_3, am1_4, am1_5],
50 | addonMouth2: [am2_1, am2_2, am2_3, am2_4, am2_5],
51 | addonMouth3: [am3_1, am3_2, am3_3, am3_4, am3_5],
52 | };
53 |
--------------------------------------------------------------------------------
/src/redux/blockchain/blockchainActions.js:
--------------------------------------------------------------------------------
1 | // constants
2 | import Web3 from "web3";
3 | import LipToken from "../../contracts/LipToken.json";
4 | // log
5 | import { fetchData } from "../data/dataActions";
6 |
7 | const connectRequest = () => {
8 | return {
9 | type: "CONNECTION_REQUEST",
10 | };
11 | };
12 |
13 | const connectSuccess = (payload) => {
14 | return {
15 | type: "CONNECTION_SUCCESS",
16 | payload: payload,
17 | };
18 | };
19 |
20 | const connectFailed = (payload) => {
21 | return {
22 | type: "CONNECTION_FAILED",
23 | payload: payload,
24 | };
25 | };
26 |
27 | const updateAccountRequest = (payload) => {
28 | return {
29 | type: "UPDATE_ACCOUNT",
30 | payload: payload,
31 | };
32 | };
33 |
34 | export const connect = () => {
35 | return async (dispatch) => {
36 | dispatch(connectRequest());
37 | if (window.ethereum) {
38 | let web3 = new Web3(window.ethereum);
39 | try {
40 | const accounts = await window.ethereum.request({
41 | method: "eth_accounts",
42 | });
43 | const networkId = await window.ethereum.request({
44 | method: "net_version",
45 | });
46 | console.log(networkId);
47 | if (networkId == 137) {
48 | const lipToken = new web3.eth.Contract(
49 | LipToken.abi,
50 | "0x247700BBab4dC984547444eCaa95f4E3Ed5dEC74"
51 | );
52 | dispatch(
53 | connectSuccess({
54 | account: accounts[0],
55 | lipToken: lipToken,
56 | web3: web3,
57 | })
58 | );
59 | // Add listeners start
60 | window.ethereum.on("accountsChanged", (accounts) => {
61 | dispatch(updateAccount(accounts[0]));
62 | });
63 | window.ethereum.on("chainChanged", () => {
64 | window.location.reload();
65 | });
66 | // Add listeners end
67 | } else {
68 | dispatch(connectFailed("Change network to Polygon."));
69 | }
70 | } catch (err) {
71 | dispatch(connectFailed("Something went wrong."));
72 | }
73 | } else {
74 | dispatch(connectFailed("Install Metamask."));
75 | }
76 | };
77 | };
78 |
79 | export const updateAccount = (account) => {
80 | return async (dispatch) => {
81 | dispatch(updateAccountRequest({ account: account }));
82 | dispatch(fetchData(account));
83 | };
84 | };
85 |
--------------------------------------------------------------------------------
/src/redux/blockchain/blockchainReducer.js:
--------------------------------------------------------------------------------
1 | const initialState = {
2 | loading: false,
3 | account: null,
4 | lipToken: null,
5 | web3: null,
6 | errorMsg: "",
7 | };
8 |
9 | const blockchainReducer = (state = initialState, action) => {
10 | switch (action.type) {
11 | case "CONNECTION_REQUEST":
12 | return {
13 | ...initialState,
14 | loading: true,
15 | };
16 | case "CONNECTION_SUCCESS":
17 | return {
18 | ...state,
19 | loading: false,
20 | account: action.payload.account,
21 | lipToken: action.payload.lipToken,
22 | web3: action.payload.web3,
23 | };
24 | case "CONNECTION_FAILED":
25 | return {
26 | ...initialState,
27 | loading: false,
28 | errorMsg: action.payload,
29 | };
30 | case "UPDATE_ACCOUNT":
31 | return {
32 | ...state,
33 | account: action.payload.account,
34 | };
35 | default:
36 | return state;
37 | }
38 | };
39 |
40 | export default blockchainReducer;
41 |
--------------------------------------------------------------------------------
/src/redux/data/dataActions.js:
--------------------------------------------------------------------------------
1 | // log
2 | import store from "../store";
3 |
4 | const fetchDataRequest = () => {
5 | return {
6 | type: "CHECK_DATA_REQUEST",
7 | };
8 | };
9 |
10 | const fetchDataSuccess = (payload) => {
11 | return {
12 | type: "CHECK_DATA_SUCCESS",
13 | payload: payload,
14 | };
15 | };
16 |
17 | const fetchDataFailed = (payload) => {
18 | return {
19 | type: "CHECK_DATA_FAILED",
20 | payload: payload,
21 | };
22 | };
23 |
24 | export const fetchData = (account) => {
25 | return async (dispatch) => {
26 | dispatch(fetchDataRequest());
27 | try {
28 | let allLips = await store
29 | .getState()
30 | .blockchain.lipToken.methods.getLips()
31 | .call();
32 | let allOwnerLips = await store
33 | .getState()
34 | .blockchain.lipToken.methods.getOwnerLips(account)
35 | .call();
36 |
37 | dispatch(
38 | fetchDataSuccess({
39 | allLips,
40 | allOwnerLips,
41 | })
42 | );
43 | } catch (err) {
44 | console.log(err);
45 | dispatch(fetchDataFailed("Could not load data from contract."));
46 | }
47 | };
48 | };
49 |
--------------------------------------------------------------------------------
/src/redux/data/dataReducer.js:
--------------------------------------------------------------------------------
1 | const initialState = {
2 | loading: false,
3 | allLips: [],
4 | allOwnerLips: [],
5 | error: false,
6 | errorMsg: "",
7 | };
8 |
9 | const dataReducer = (state = initialState, action) => {
10 | switch (action.type) {
11 | case "CHECK_DATA_REQUEST":
12 | return {
13 | ...initialState,
14 | loading: true,
15 | };
16 | case "CHECK_DATA_SUCCESS":
17 | return {
18 | ...initialState,
19 | loading: false,
20 | allLips: action.payload.allLips,
21 | allOwnerLips: action.payload.allOwnerLips,
22 | };
23 | case "CHECK_DATA_FAILED":
24 | return {
25 | ...initialState,
26 | loading: false,
27 | error: true,
28 | errorMsg: action.payload,
29 | };
30 | default:
31 | return state;
32 | }
33 | };
34 |
35 | export default dataReducer;
36 |
--------------------------------------------------------------------------------
/src/redux/store.js:
--------------------------------------------------------------------------------
1 | import { applyMiddleware, compose, createStore, combineReducers } from "redux";
2 | import thunk from "redux-thunk";
3 | import blockchainReducer from "./blockchain/blockchainReducer";
4 | import dataReducer from "./data/dataReducer";
5 |
6 | const rootReducer = combineReducers({
7 | blockchain: blockchainReducer,
8 | data: dataReducer,
9 | });
10 |
11 | const middleware = [thunk];
12 | const composeEnhancers = compose(applyMiddleware(...middleware));
13 |
14 | const configureStore = () => {
15 | return createStore(rootReducer, composeEnhancers);
16 | };
17 |
18 | const store = configureStore();
19 |
20 | export default store;
21 |
--------------------------------------------------------------------------------
/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/src/styles/globalStyles.js:
--------------------------------------------------------------------------------
1 | import styled from "styled-components";
2 |
3 | // Used for wrapping a page component
4 | export const Screen = styled.div`
5 | background-color: var(--dark-grey);
6 | background-image: ${({ image }) => (image ? `url(${image})` : "none")};
7 | background-size: cover;
8 | background-position: center;
9 | width: 100%;
10 | min-height: 100vh;
11 | display: flex;
12 | flex-direction: column;
13 | `;
14 |
15 | // Used for providing space between components
16 | export const SpacerXSmall = styled.div`
17 | height: 8px;
18 | width: 8px;
19 | `;
20 |
21 | // Used for providing space between components
22 | export const SpacerSmall = styled.div`
23 | height: 16px;
24 | width: 16px;
25 | `;
26 |
27 | // Used for providing space between components
28 | export const SpacerMedium = styled.div`
29 | height: 24px;
30 | width: 24px;
31 | `;
32 |
33 | // Used for providing space between components
34 | export const SpacerLarge = styled.div`
35 | height: 32px;
36 | width: 32px;
37 | `;
38 |
39 | // Used for providing a wrapper around a component
40 | export const Container = styled.div`
41 | display: flex;
42 | flex: ${({ flex }) => (flex ? flex : 0)};
43 | flex-direction: ${({ fd }) => (fd ? fd : "column")};
44 | justify-content: ${({ jc }) => (jc ? jc : "flex-start")};
45 | align-items: ${({ ai }) => (ai ? ai : "flex-start")};
46 | background-color: ${({ test }) => (test ? "pink" : "none")};
47 | width: 100%;
48 | background-image: ${({ image }) => (image ? `url(${image})` : "none")};
49 | background-size: cover;
50 | background-position: center;
51 | `;
52 |
53 | export const TextTitle = styled.p`
54 | color: var(--white);
55 | font-size: 20px;
56 | font-weight: 500;
57 | `;
58 |
59 | export const TextSubTitle = styled.p`
60 | color: var(--white);
61 | font-size: 16px;
62 | font-weight: 500;
63 | `;
64 |
65 | export const TextDescription = styled.p`
66 | color: var(--white);
67 | font-size: 14px;
68 | font-weight: 600;
69 | `;
70 |
71 | export const StyledClickable = styled.div`
72 | :active {
73 | opacity: 0.6;
74 | }
75 | `;
76 |
--------------------------------------------------------------------------------
/src/styles/reset.css:
--------------------------------------------------------------------------------
1 | html,
2 | body,
3 | div,
4 | span,
5 | applet,
6 | object,
7 | iframe,
8 | h1,
9 | h2,
10 | h3,
11 | h4,
12 | h5,
13 | h6,
14 | p,
15 | blockquote,
16 | pre,
17 | a,
18 | abbr,
19 | acronym,
20 | address,
21 | big,
22 | cite,
23 | code,
24 | del,
25 | dfn,
26 | em,
27 | img,
28 | ins,
29 | kbd,
30 | q,
31 | s,
32 | samp,
33 | small,
34 | strike,
35 | strong,
36 | sub,
37 | sup,
38 | tt,
39 | var,
40 | b,
41 | u,
42 | i,
43 | center,
44 | dl,
45 | dt,
46 | dd,
47 | ol,
48 | ul,
49 | li,
50 | fieldset,
51 | form,
52 | label,
53 | legend,
54 | table,
55 | caption,
56 | tbody,
57 | tfoot,
58 | thead,
59 | tr,
60 | th,
61 | td,
62 | article,
63 | aside,
64 | canvas,
65 | details,
66 | embed,
67 | figure,
68 | figcaption,
69 | footer,
70 | header,
71 | hgroup,
72 | menu,
73 | nav,
74 | output,
75 | ruby,
76 | section,
77 | summary,
78 | time,
79 | mark,
80 | audio,
81 | video {
82 | margin: 0;
83 | padding: 0;
84 | border: 0;
85 | font-size: 100%;
86 | font: inherit;
87 | vertical-align: baseline;
88 | }
89 | /* HTML5 display-role reset for older browsers */
90 | article,
91 | aside,
92 | details,
93 | figcaption,
94 | figure,
95 | footer,
96 | header,
97 | hgroup,
98 | menu,
99 | nav,
100 | section {
101 | display: block;
102 | }
103 | body {
104 | line-height: 1;
105 | }
106 | ol,
107 | ul {
108 | list-style: none;
109 | }
110 | blockquote,
111 | q {
112 | quotes: none;
113 | }
114 | blockquote:before,
115 | blockquote:after,
116 | q:before,
117 | q:after {
118 | content: "";
119 | content: none;
120 | }
121 | table {
122 | border-collapse: collapse;
123 | border-spacing: 0;
124 | }
125 |
126 | body {
127 | margin: 0;
128 | font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Oxygen", "Ubuntu",
129 | "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
130 | -webkit-font-smoothing: antialiased;
131 | -moz-osx-font-smoothing: grayscale;
132 | }
133 |
134 | * {
135 | margin: 0;
136 | padding: 0;
137 | box-sizing: border-box;
138 | }
139 |
140 | code {
141 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
142 | monospace;
143 | }
144 |
145 | body::-webkit-scrollbar {
146 | display: none;
147 | }
148 |
149 | /* Hide scrollbar for IE, Edge and Firefox */
150 | body {
151 | -ms-overflow-style: none; /* IE and Edge */
152 | scrollbar-width: none; /* Firefox */
153 | font-family: "Baloo 2";
154 | }
155 |
156 | html {
157 | background-color: "#4C4C4C";
158 | }
159 |
160 | div {
161 | -moz-user-select: none;
162 | -webkit-user-select: none;
163 | -ms-user-select: none;
164 | user-select: none;
165 | -o-user-select: none;
166 | }
167 |
--------------------------------------------------------------------------------
/src/styles/theme.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --yellow: #fccd35;
3 | --pink: #ff19e9;
4 | --green: #00cc00;
5 | --white: #ffffff;
6 | --light-grey: #b1b1b1;
7 | --dark-grey: #2b2b2b;
8 | --black: #000000;
9 | }
10 |
--------------------------------------------------------------------------------
/truffle-config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Use this file to configure your truffle project. It's seeded with some
3 | * common settings for different networks and features like migrations,
4 | * compilation and testing. Uncomment the ones you need or modify
5 | * them to suit your project as necessary.
6 | *
7 | * More information about configuration can be found at:
8 | *
9 | * trufflesuite.com/docs/advanced/configuration
10 | *
11 | * To deploy via Infura you'll need a wallet provider (like @truffle/hdwallet-provider)
12 | * to sign your transactions before they're sent to a remote public node. Infura accounts
13 | * are available for free at: infura.io/register.
14 | *
15 | * You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
16 | * public/private key pairs. If you're publishing your code to GitHub make sure you load this
17 | * phrase from a file you've .gitignored so it doesn't accidentally become public.
18 | *
19 | */
20 |
21 | // const HDWalletProvider = require('@truffle/hdwallet-provider');
22 | // const infuraKey = "fj4jll3k.....";
23 | //
24 | // const fs = require('fs');
25 | // const mnemonic = fs.readFileSync(".secret").toString().trim();
26 |
27 | module.exports = {
28 | /**
29 | * Networks define how you connect to your ethereum client and let you set the
30 | * defaults web3 uses to send transactions. If you don't specify one truffle
31 | * will spin up a development blockchain for you on port 9545 when you
32 | * run `develop` or `test`. You can ask a truffle command to use a specific
33 | * network from the command line, e.g
34 | *
35 | * $ truffle test --network
36 | */
37 |
38 | networks: {
39 | // Useful for testing. The `development` name is special - truffle uses it by default
40 | // if it's defined here and no other network is specified at the command line.
41 | // You should run a client (like ganache-cli, geth or parity) in a separate terminal
42 | // tab if you use this network and you must also set the `host`, `port` and `network_id`
43 | // options below to some value.
44 | //
45 | development: {
46 | host: "127.0.0.1", // Localhost (default: none)
47 | port: 8545, // Standard Ethereum port (default: none)
48 | network_id: "*", // Any network (default: none)
49 | },
50 | // Another network with more advanced options...
51 | // advanced: {
52 | // port: 8777, // Custom port
53 | // network_id: 1342, // Custom network
54 | // gas: 8500000, // Gas sent with each transaction (default: ~6700000)
55 | // gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
56 | // from: , // Account to send txs from (default: accounts[0])
57 | // websocket: true // Enable EventEmitter interface for web3 (default: false)
58 | // },
59 | // Useful for deploying to a public network.
60 | // NB: It's important to wrap the provider as a function.
61 | // ropsten: {
62 | // provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
63 | // network_id: 3, // Ropsten's id
64 | // gas: 5500000, // Ropsten has a lower block limit than mainnet
65 | // confirmations: 2, // # of confs to wait between deployments. (default: 0)
66 | // timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
67 | // skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
68 | // },
69 | // Useful for private networks
70 | // private: {
71 | // provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
72 | // network_id: 2111, // This network is yours, in the cloud.
73 | // production: true // Treats this network as if it was a public net. (default: false)
74 | // }
75 | },
76 |
77 | // Set default mocha options here, use special reporters etc.
78 | mocha: {
79 | // timeout: 100000
80 | },
81 |
82 | // Configure your compilers
83 | contracts_build_directory: "./src/contracts/",
84 | compilers: {
85 | solc: {
86 | version: "0.8.0", // Fetch exact version from solc-bin (default: truffle's version)
87 | settings: {
88 | // See the solidity docs for advice about optimization and evmVersion
89 | optimizer: {
90 | enabled: true,
91 | runs: 200,
92 | },
93 | },
94 | },
95 | },
96 |
97 | // Truffle DB is currently disabled by default; to enable it, change enabled: false to enabled: true
98 | //
99 | // Note: if you migrated your contracts prior to enabling this field in your Truffle project and want
100 | // those previously migrated contracts available in the .db directory, you will need to run the following:
101 | // $ truffle migrate --reset --compile-all
102 |
103 | db: {
104 | enabled: false,
105 | },
106 | };
107 |
--------------------------------------------------------------------------------