├── README.md └── SimpleStorage.sol /README.md: -------------------------------------------------------------------------------- 1 | This is part of the FreeCodeCamp Solidity & Javascript Blockchain Course. 2 | 3 | Video Link : https://www.youtube.com/watch?v=gyMwXuJrbJQ&t=7276s 4 | 5 | TimeStamp : (02:01:16) 6 | ## Getting Started 7 | 8 | 1. Go to [Remix](https://remix.ethereum.org/) 9 | 2. Paste the code from `SimpleStorage.sol` into a new file in Remix 10 | 3. Hit `Compile` 11 | 4. Hit `Deploy` 12 | 13 | For a more in depth blog on working with remix, [read here](https://docs.chain.link/docs/deploy-your-first-contract/) 14 | 15 | # Thank you! 16 | 17 | If you appreciated this, feel free to follow me or donate! 18 | 19 | ETH/Polygon/Avalanche/etc Address: 0x9680201d9c93d65a3603d2088d125e955c73BD65 20 | 21 | [![Patrick Collins Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/PatrickAlphaC) 22 | [![Patrick Collins YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UCn-3f8tw_E1jZvhuHatROwA) 23 | [![Patrick Collins Linkedin](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/patrickalphac/) 24 | [![Patrick Collins Medium](https://img.shields.io/badge/Medium-000000?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@patrick.collins_58673/) 25 | -------------------------------------------------------------------------------- /SimpleStorage.sol: -------------------------------------------------------------------------------- 1 | // I'm a comment! 2 | // SPDX-License-Identifier: MIT 3 | 4 | pragma solidity 0.8.8; 5 | // pragma solidity ^0.8.0; 6 | // pragma solidity >=0.8.0 <0.9.0; 7 | 8 | contract SimpleStorage { 9 | 10 | uint256 favoriteNumber; 11 | 12 | struct People { 13 | uint256 favoriteNumber; 14 | string name; 15 | } 16 | // uint256[] public anArray; 17 | People[] public people; 18 | 19 | mapping(string => uint256) public nameToFavoriteNumber; 20 | 21 | function store(uint256 _favoriteNumber) public { 22 | favoriteNumber = _favoriteNumber; 23 | } 24 | 25 | function retrieve() public view returns (uint256){ 26 | return favoriteNumber; 27 | } 28 | 29 | function addPerson(string memory _name, uint256 _favoriteNumber) public { 30 | people.push(People(_favoriteNumber, _name)); 31 | nameToFavoriteNumber[_name] = _favoriteNumber; 32 | } 33 | } 34 | 35 | --------------------------------------------------------------------------------