This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const config: HardhatUserConfig = { | |
| defaultNetwork: "hardhat", | |
| solidity: { | |
| compilers: [{ version: "0.8.0", settings: {} }], | |
| }, | |
| networks: { | |
| hardhat: {}, | |
| localhost: {}, | |
| rinkeby: { | |
| url: `https://rinkeby.infura.io/v3/${INFURA_API_KEY}`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; | |
| import '@openzeppelin/contracts/access/Ownable.sol'; | |
| contract PaperCats is ERC721Enumerable, Ownable { | |
| string _baseTokenURI; | |
| bool public _paused = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function adopt(uint256 amount) public payable { | |
| require(amount < 4, "You can adopt a maximum of 3 Paper Cats"); | |
| require(!_paused, "Sale paused"); | |
| require(msg.value == _price * amount, "Ether sent is not correct"); | |
| for (uint256 i; i < amount; i++) { | |
| _safeMint(msg.sender, totalSupply()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function walletOfOwner(address _owner) public view returns(uint256[] memory) { | |
| uint256 tokenCount = balanceOf(_owner); | |
| uint256[] memory tokensId = new uint256[](tokenCount); | |
| for(uint256 i; i < tokenCount; i++) { | |
| tokensId[i] = tokenOfOwnerByIndex(_owner, i); | |
| } | |
| return tokensId; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bool public _paused = true; | |
| function pause(bool val) public onlyOwner { | |
| _paused = val; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uint256 public _price = 0.0005 ether; | |
| address _communityWallet = 0xB93A6D9D539e7EDB0858Eb53a3e1501d51935752; | |
| function setPrice(uint256 _newPrice) public onlyOwner { | |
| _price = _newPrice; | |
| } | |
| function withdrawAll() public onlyOwner { | |
| require(payable(_communityWallet).send(address(this).balance)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; | |
| import '@openzeppelin/contracts/access/Ownable.sol'; | |
| contract PaperCats is ERC721Enumerable, Ownable { | |
| string _baseTokenURI; | |
| constructor(string memory baseURI) ERC721("Paper Cats", "PCATS") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; | |
| import '@openzeppelin/contracts/access/Ownable.sol'; | |
| contract PaperCats is ERC721Enumerable, Ownable { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image, ImageDraw | |
| import pathlib | |
| def create_cat_with_heart(id): | |
| image = Image.open("Paper_Cat_Transparent.png") | |
| path = "heart_cats/" | |
| new_image = Image.new("RGB", image.size, get_background_colour()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pathlib | |
| from PIL import Image | |
| # Layer the transparent Paper Cat onto a random solid coloured background. | |
| def create_cat(id): | |
| image = Image.open("Paper_Cat_Transparent.png") | |
| path = "cats/" | |
| new_image = Image.new("RGB", image.size, get_background_colour()) |
NewerOlder