{"id":384470,"date":"2024-06-29T05:31:26","date_gmt":"2024-06-29T05:31:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=384470"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=384470","title":{"rendered":"<span>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043d\u0430 Golang + Ethereum (\u0447\u0430\u0441\u0442\u044c 3)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440.\u00a0<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c <a href=\"https:\/\/habr.com\/ru\/post\/595723\/\" rel=\"noopener noreferrer nofollow\">\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c 10 000 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 <\/a>\u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Golang, \u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/595763\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u0432\u0441\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/a> \u0432 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 IPFS.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u043e\u043f\u044b\u0442\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u0434\u043b\u044f NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 Ethereum. <\/p>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0435\u0442\u044c Ethereum. \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043c\u044b \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043e\u0434\u0438\u043d\u0433\u0443, \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 ERC-721 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e NFT \u0442\u043e\u043a\u0435\u043d\u043e\u0432. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">    function balanceOf(address _owner) external view returns (uint256);     function ownerOf(uint256 _tokenId) external view returns (address);     function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;     function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;     function transferFrom(address _from, address _to, uint256 _tokenId) external payable;     function approve(address _approved, uint256 _tokenId) external payable;     function setApprovalForAll(address _operator, bool _approved) external;     function getApproved(uint256 _tokenId) external view returns (address);     function isApprovedForAll(address _owner, address _operator) external view returns (bool); <\/code><\/pre>\n<p>\u041f\u043e\u043b\u043d\u0443\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e ERC-721 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/ethereum.org\/en\/developers\/docs\/standards\/tokens\/erc-721\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0441\u0430\u043c\u0438\u043c, \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: <a href=\"https:\/\/github.com\/OpenZeppelin\/openzeppelin-contracts\" rel=\"noopener noreferrer nofollow\">OpenZeppelin<\/a> &#8212; \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043d\u0435\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u041f\u043b\u044e\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b:<\/p>\n<ul>\n<li>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0438\u0437 \u043f\u043e\u0434 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 \u0430\u0443\u0434\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0410\u0443\u0434\u0438\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0437\u0430\u0439\u043c\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0435\u043d\u0435\u0433 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439  NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0451 <em>MonkeyNFT<\/em>. \u041d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435  <a href=\"https:\/\/github.com\/OpenZeppelin\/openzeppelin-contracts\" rel=\"noopener noreferrer nofollow\">OpenZeppelin<\/a> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>ERC721 \/ ERC721Enumerable &#8212; \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e NFT \u0442\u043e\u043a\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>Ownable &#8212; \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u0430\u043a <a href=\"https:\/\/hardhat.org\/\" rel=\"noopener noreferrer nofollow\">hardhat<\/a>, \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u0435\u043f\u043b\u043e\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0441\u0442\u0430\u043b \u043e\u0442 <a href=\"https:\/\/trufflesuite.com\/ganache\/\" rel=\"noopener noreferrer nofollow\">Truffle<\/a> \u0438 \u0435\u0433\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u0430\u0433\u043e\u0432.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npx hardhat init<\/code>, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u0434\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>contracts<\/em> \u0438 \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434: <\/p>\n<pre><code class=\"javascript\">\/\/ SPDX-License-Identifier: MIT pragma solidity ^0.8.0;  import \"@openzeppelin\/contracts\/utils\/Context.sol\"; import \"@openzeppelin\/contracts\/token\/ERC721\/ERC721.sol\"; import \"@openzeppelin\/contracts\/access\/Ownable.sol\"; import \"@openzeppelin\/contracts\/utils\/math\/SafeMath.sol\"; import \"@openzeppelin\/contracts\/token\/ERC721\/extensions\/ERC721Enumerable.sol\"; import \"@openzeppelin\/contracts\/token\/ERC721\/extensions\/ERC721URIStorage.sol\";  contract MonkeyNFT is ERC721, ERC721Enumerable, Ownable {      using SafeMath for uint256;     uint public constant maxPurchase = 10;     uint256 public constant MAX_MONKEYS = 10000;      uint256 private _monkeyPrice = 80000000000000000; \/\/0.08 ETH     string private baseURI;     bool public saleIsActive = true;      constructor() ERC721(\"The Monkey NFT\", \"MNK\") {     }          function _beforeTokenTransfer(address from, address to, uint256 tokenId)         internal         override(ERC721, ERC721Enumerable)     {         super._beforeTokenTransfer(from, to, tokenId);     }          function supportsInterface(bytes4 interfaceId)         public         view         override(ERC721, ERC721Enumerable)         returns (bool)     {         return super.supportsInterface(interfaceId);     }  function withdraw() public onlyOwner { uint256 balance = address(this).balance; payable(msg.sender).transfer(balance); }          function setPrice(uint256 _newPrice) public onlyOwner() {         _monkeyPrice = _newPrice;     }      function getPrice() public view returns (uint256){         return _monkeyPrice;     }      function mintMonkeys(uint numberOfTokens) public payable {         require(saleIsActive, \"Sale must be active to mint Monkeys\");         require(numberOfTokens &lt;= maxPurchase, \"Can only mint 10 tokens at a time\");         require(totalSupply().add(numberOfTokens) &lt;= MAX_MONKEYS, \"Purchase would exceed max supply of Monkeys\");         require(_monkeyPrice.mul(numberOfTokens) &lt;= msg.value, \"Ether value sent is not correct\");                  for(uint i = 0; i &lt; numberOfTokens; i++) {             uint mintIndex = totalSupply();             if (totalSupply() &lt; MAX_MONKEYS) {                 _safeMint(msg.sender, mintIndex);             }         }     }            function _baseURI() internal view override returns (string memory) {         return baseURI;     }          function setBaseURI(string memory newBaseURI) public onlyOwner {         baseURI = newBaseURI;     }      function flipSaleState() public onlyOwner {         saleIsActive = !saleIsActive;     }   }  <\/code><\/pre>\n<p>\u0418\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e:<\/p>\n<ul>\n<li>\n<p>\u0424\u043b\u0430\u0433 <code>saleIsActive<\/code> &#8212; \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043b\u0438\u0431\u043e \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u043f\u0440\u043e\u0434\u0430\u0436\u0435, \u043b\u0438\u0431\u043e \u043d\u0435\u0442. \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e \u043a\u0430\u043a\u0438\u043c \u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>maxPurchase<\/code> \u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043b-\u0432\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043a\u0443\u043f\u0438\u0442\u044c \u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0431\u043e\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u043a\u0443\u043f\u0438\u043b\u0438 \u0432\u0441\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0441\u0440\u0430\u0437\u0443. <\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>mintMonkey<\/code> &#8212; \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442  \u043a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0448 NFT \u0442\u043e\u043a\u0435\u043d. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <code>payable<\/code>, \u043a\u0430\u043a \u0440\u0430\u0437 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043b\u0430\u0442\u043d\u044b\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npx hardhat compile<\/code>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0443\u0442\u0441\u044f abi-\u0430\u0440\u0442\u0438\u0444\u0430\u043a\u0442\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>artifacts<\/em>.<\/p>\n<h3>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/h3>\n<p>\u0422.\u043a. \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0435\u043b\u044c\u0437\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e \u0434\u0435\u043f\u043b\u043e\u044f \u0432 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d Ethereum. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>test, <\/em>\u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0438:<\/p>\n<pre><code class=\"javascript\">const { expect } = require(\"chai\");  describe(\"Token contract\", () => {    let contract;   let owner;   let addr1;   let addr2;   let addrs;   let baseURI;    beforeEach(async () => {     const Token = await ethers.getContractFactory(\"MonkeyNFT\");     [owner, addr1, addr2, ...addrs] = await ethers.getSigners();     contract = await Token.deploy();     baseURI = \"https:\/\/hardhat.org\/test\/\"     await contract.setBaseURI(baseURI)   });    it(\"Should initialize contract\", async () => {     expect(await contract.MAX_MONKEYS()).to.equal(10000);   });   it(\"Should set the right owner\", async () => {     expect(await contract.owner()).to.equal(await owner.address);   });   it(\"Should mint\", async () => {     const price = await contract.getPrice();     const tokenId = await contract.totalSupply();     expect(       await contract.mintMonkeys(1, {         value: price,       })     ).to.emit(contract, \"Transfer\").withArgs(ethers.constants.AddressZero, owner.address, tokenId);       expect(await contract.tokenURI(tokenId)).to.equal(baseURI+\"0\");   }); });<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>npx hardhat test<\/code>. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043c:<\/p>\n<pre><code class=\"bash\">Compiling 1 file with 0.8.4 Compilation finished successfully     Token contract     \u2713 Should initialize contract     \u2713 Should set the right owner     \u2713 Should mint (41ms)     3 passing (1s)<\/code><\/pre>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u043b\u0438 \u043f\u043b\u0430\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>mintMonkeys<\/code> \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438 NFT \u0442\u043e\u043a\u0435\u043d\u0430 <\/p>\n<\/li>\n<\/ul>\n<h3>\u0414\u0435\u043f\u043b\u043e\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/h3>\n<p>\u0414\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0435\u0442\u044c Ethereum. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>scripts<\/em> \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043e\u043d\u0438 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u044c\u0441\u044f \u0438 \u043f\u0438\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442  \u0434\u0435\u043f\u043b\u043e\u044f:<\/p>\n<pre><code class=\"json\">async function main() {     const [deployer] = await ethers.getSigners();        console.log(\"Deploying contracts with the account:\", deployer.address);        console.log(\"Account balance:\", (await deployer.getBalance()).toString());        const Token = await ethers.getContractFactory(\"MonkeyNFT\");      console.log(\"Deploying contract...\");     const token = await Token.deploy();     await token.deployed();     console.log(\"Token address:\", token.address);   }      main()     .then(() => process.exit(0))     .catch((error) => {       console.error(error);       process.exit(1);     }); <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b <em>hardhat.config <\/em>\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">require(\"@nomiclabs\/hardhat-waffle\"); require(\"@nomiclabs\/hardhat-etherscan\");  module.exports = {   solidity: \"0.8.4\",   networks: {     rinkeby: {       url: `https:\/\/eth-rinkeby.alchemyapi.io\/v2\/${YOUR_API_KEY}`,     },   }, };<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442: <code>npx hardhat run scripts\/deploy.js --network rinkeby<\/code><\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0448\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e web3.js.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/596343\/\"> https:\/\/habr.com\/ru\/articles\/596343\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440.\u00a0<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c <a href=\"https:\/\/habr.com\/ru\/post\/595723\/\" rel=\"noopener noreferrer nofollow\">\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c 10 000 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 <\/a>\u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Golang, \u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/595763\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u0432\u0441\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/a> \u0432 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 IPFS.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u043e\u043f\u044b\u0442\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u0434\u043b\u044f NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 Ethereum. <\/p>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0435\u0442\u044c Ethereum. \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043c\u044b \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043e\u0434\u0438\u043d\u0433\u0443, \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 ERC-721 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e NFT \u0442\u043e\u043a\u0435\u043d\u043e\u0432. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">    function balanceOf(address _owner) external view returns (uint256);     function ownerOf(uint256 _tokenId) external view returns (address);     function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;     function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;     function transferFrom(address _from, address _to, uint256 _tokenId) external payable;     function approve(address _approved, uint256 _tokenId) external payable;     function setApprovalForAll(address _operator, bool _approved) external;     function getApproved(uint256 _tokenId) external view returns (address);     function isApprovedForAll(address _owner, address _operator) external view returns (bool); <\/code><\/pre>\n<p>\u041f\u043e\u043b\u043d\u0443\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e ERC-721 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/ethereum.org\/en\/developers\/docs\/standards\/tokens\/erc-721\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0441\u0430\u043c\u0438\u043c, \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: <a href=\"https:\/\/github.com\/OpenZeppelin\/openzeppelin-contracts\" rel=\"noopener noreferrer nofollow\">OpenZeppelin<\/a> &#8212; \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043d\u0435\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u041f\u043b\u044e\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b:<\/p>\n<ul>\n<li>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0438\u0437 \u043f\u043e\u0434 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 \u0430\u0443\u0434\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0410\u0443\u0434\u0438\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0437\u0430\u0439\u043c\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0435\u043d\u0435\u0433 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439  NFT \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0451 <em>MonkeyNFT<\/em>. \u041d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435  <a href=\"https:\/\/github.com\/OpenZeppelin\/openzeppelin-contracts\" rel=\"noopener noreferrer nofollow\">OpenZeppelin<\/a> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>ERC721 \/ ERC721Enumerable &#8212; \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e NFT \u0442\u043e\u043a\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>Ownable &#8212; \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u0430\u043a <a href=\"https:\/\/hardhat.org\/\" rel=\"noopener noreferrer nofollow\">hardhat<\/a>, \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u0435\u043f\u043b\u043e\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0441\u0442\u0430\u043b \u043e\u0442 <a href=\"https:\/\/trufflesuite.com\/ganache\/\" rel=\"noopener noreferrer nofollow\">Truffle<\/a> \u0438 \u0435\u0433\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u0430\u0433\u043e\u0432.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npx hardhat init<\/code>, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u0434\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>contracts<\/em> \u0438 \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434: <\/p>\n<pre><code class=\"javascript\">\/\/ SPDX-License-Identifier: MIT pragma solidity ^0.8.0;  import \"@openzeppelin\/contracts\/utils\/Context.sol\"; import \"@openzeppelin\/contracts\/token\/ERC721\/ERC721.sol\"; import \"@openzeppelin\/contracts\/access\/Ownable.sol\"; import \"@openzeppelin\/contracts\/utils\/math\/SafeMath.sol\"; import \"@openzeppelin\/contracts\/token\/ERC721\/extensions\/ERC721Enumerable.sol\"; import \"@openzeppelin\/contracts\/token\/ERC721\/extensions\/ERC721URIStorage.sol\";  contract MonkeyNFT is ERC721, ERC721Enumerable, Ownable {      using SafeMath for uint256;     uint public constant maxPurchase = 10;     uint256 public constant MAX_MONKEYS = 10000;      uint256 private _monkeyPrice = 80000000000000000; \/\/0.08 ETH     string private baseURI;     bool public saleIsActive = true;      constructor() ERC721(\"The Monkey NFT\", \"MNK\") {     }          function _beforeTokenTransfer(address from, address to, uint256 tokenId)         internal         override(ERC721, ERC721Enumerable)     {         super._beforeTokenTransfer(from, to, tokenId);     }          function supportsInterface(bytes4 interfaceId)         public         view         override(ERC721, ERC721Enumerable)         returns (bool)     {         return super.supportsInterface(interfaceId);     }  function withdraw() public onlyOwner { uint256 balance = address(this).balance; payable(msg.sender).transfer(balance); }          function setPrice(uint256 _newPrice) public onlyOwner() {         _monkeyPrice = _newPrice;     }      function getPrice() public view returns (uint256){         return _monkeyPrice;     }      function mintMonkeys(uint numberOfTokens) public payable {         require(saleIsActive, \"Sale must be active to mint Monkeys\");         require(numberOfTokens &lt;= maxPurchase, \"Can only mint 10 tokens at a time\");         require(totalSupply().add(numberOfTokens) &lt;= MAX_MONKEYS, \"Purchase would exceed max supply of Monkeys\");         require(_monkeyPrice.mul(numberOfTokens) &lt;= msg.value, \"Ether value sent is not correct\");                  for(uint i = 0; i &lt; numberOfTokens; i++) {             uint mintIndex = totalSupply();             if (totalSupply() &lt; MAX_MONKEYS) {                 _safeMint(msg.sender, mintIndex);             }         }     }            function _baseURI() internal view override returns (string memory) {         return baseURI;     }          function setBaseURI(string memory newBaseURI) public onlyOwner {         baseURI = newBaseURI;     }      function flipSaleState() public onlyOwner {         saleIsActive = !saleIsActive;     }   }  <\/code><\/pre>\n<p>\u0418\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e:<\/p>\n<ul>\n<li>\n<p>\u0424\u043b\u0430\u0433 <code>saleIsActive<\/code> &#8212; \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043b\u0438\u0431\u043e \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u043f\u0440\u043e\u0434\u0430\u0436\u0435, \u043b\u0438\u0431\u043e \u043d\u0435\u0442. \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e \u043a\u0430\u043a\u0438\u043c \u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>maxPurchase<\/code> \u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043b-\u0432\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043a\u0443\u043f\u0438\u0442\u044c \u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0431\u043e\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u043a\u0443\u043f\u0438\u043b\u0438 \u0432\u0441\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0441\u0440\u0430\u0437\u0443. <\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>mintMonkey<\/code> &#8212; \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442  \u043a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0448 NFT \u0442\u043e\u043a\u0435\u043d. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <code>payable<\/code>, \u043a\u0430\u043a \u0440\u0430\u0437 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043b\u0430\u0442\u043d\u044b\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npx hardhat compile<\/code>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0443\u0442\u0441\u044f abi-\u0430\u0440\u0442\u0438\u0444\u0430\u043a\u0442\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>artifacts<\/em>.<\/p>\n<h3>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/h3>\n<p>\u0422.\u043a. \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0435\u043b\u044c\u0437\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e \u0434\u0435\u043f\u043b\u043e\u044f \u0432 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d Ethereum. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>test, <\/em>\u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0438:<\/p>\n<pre><code class=\"javascript\">const { expect } = require(\"chai\");  describe(\"Token contract\", () => {    let contract;   let owner;   let addr1;   let addr2;   let addrs;   let baseURI;    beforeEach(async () => {     const Token = await ethers.getContractFactory(\"MonkeyNFT\");     [owner, addr1, addr2, ...addrs] = await ethers.getSigners();     contract = await Token.deploy();     baseURI = \"https:\/\/hardhat.org\/test\/\"     await contract.setBaseURI(baseURI)   });    it(\"Should initialize contract\", async () => {     expect(await contract.MAX_MONKEYS()).to.equal(10000);   });   it(\"Should set the right owner\", async () => {     expect(await contract.owner()).to.equal(await owner.address);   });   it(\"Should mint\", async () => {     const price = await contract.getPrice();     const tokenId = await contract.totalSupply();     expect(       await contract.mintMonkeys(1, {         value: price,       })     ).to.emit(contract, \"Transfer\").withArgs(ethers.constants.AddressZero, owner.address, tokenId);       expect(await contract.tokenURI(tokenId)).to.equal(baseURI+\"0\");   }); });<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>npx hardhat test<\/code>. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043c:<\/p>\n<pre><code class=\"bash\">Compiling 1 file with 0.8.4 Compilation finished successfully     Token contract     \u2713 Should initialize contract     \u2713 Should set the right owner     \u2713 Should mint (41ms)     3 passing (1s)<\/code><\/pre>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u043b\u0438 \u043f\u043b\u0430\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>mintMonkeys<\/code> \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438 NFT \u0442\u043e\u043a\u0435\u043d\u0430 <\/p>\n<\/li>\n<\/ul>\n<h3>\u0414\u0435\u043f\u043b\u043e\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/h3>\n<p>\u0414\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0435\u0442\u044c Ethereum. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>scripts<\/em> \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043e\u043d\u0438 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u044c\u0441\u044f \u0438 \u043f\u0438\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442  \u0434\u0435\u043f\u043b\u043e\u044f:<\/p>\n<pre><code class=\"json\">async function main() {     const [deployer] = await ethers.getSigners();        console.log(\"Deploying contracts with the account:\", deployer.address);        console.log(\"Account balance:\", (await deployer.getBalance()).toString());        const Token = await ethers.getContractFactory(\"MonkeyNFT\");      console.log(\"Deploying contract...\");     const token = await Token.deploy();     await token.deployed();     console.log(\"Token address:\", token.address);   }      main()     .then(() => process.exit(0))     .catch((error) => {       console.error(error);       process.exit(1);     }); <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b <em>hardhat.config <\/em>\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">require(\"@nomiclabs\/hardhat-waffle\"); require(\"@nomiclabs\/hardhat-etherscan\");  module.exports = {   solidity: \"0.8.4\",   networks: {     rinkeby: {       url: `https:\/\/eth-rinkeby.alchemyapi.io\/v2\/${YOUR_API_KEY}`,     },   }, };<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442: <code>npx hardhat run scripts\/deploy.js --network rinkeby<\/code><\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0448\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e web3.js.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/596343\/\"> https:\/\/habr.com\/ru\/articles\/596343\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-384470","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/384470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=384470"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/384470\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=384470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=384470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=384470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}