{"id":339241,"date":"2022-10-03T15:00:22","date_gmt":"2022-10-03T15:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=339241"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=339241","title":{"rendered":"<span>\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e AccessControl \u043e\u0442 OpenZeppelin<\/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>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u043a AccessControl \u043e\u0442 OpenZeppelin, \u0434\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 \u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u0443\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430\u0445 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e.<\/p>\n<p>\u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u043b\u0438, \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0440\u043e\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0438 \u0434\u0430\u0436\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u043e\u043b\u0438. \u042d\u0442\u043e \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0439, \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0443\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043a \u0434\u0435\u043b\u0443!<\/p>\n<p>\u0414\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0442\u043a\u0440\u044b\u0442\u044c <a href=\"https:\/\/github.com\/OpenZeppelin\/openzeppelin-contracts\/blob\/master\/contracts\/access\/AccessControl.sol\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a> \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u043e\u043b\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/793\/a15\/7bf\/793a157bf41c16c442e4acda803b2425.png\" alt=\"\u041f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\" title=\"\u041f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\" width=\"669\" height=\"227\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/793\/a15\/7bf\/793a157bf41c16c442e4acda803b2425.png\"\/><figcaption>\u041f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 AccessControl \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <em>RoleData<\/em> &#8212; \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0440\u043e\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>mapping <em>members<\/em> &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0440\u043e\u043b\u044c\u044e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f <em>true\/false<\/em>;<\/p>\n<\/li>\n<li>\n<p><em>adminRole<\/em> &#8212; \u0437\u0434\u0435\u0441\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0445\u044d\u0448 \u0440\u043e\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430 \u0440\u043e\u043b\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c <em>adminRole<\/em>, \u0442\u043e \u044f \u043c\u043e\u0433\u0443 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 mapping <em>members<\/em>, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0442\u043e \u0432 \u0441\u043b\u043e\u0442\u0435 <em>adminRole<\/em> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448(0x0000000000000000000000000000000000000000000000000000000000000000), \u0442\u043e \u0435\u0441\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 <em>DEFAULT_ADMIN_ROLE<\/em>. \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e <em>DEFAULT_ADMIN_ROLE<\/em>? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 57.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>RoleData<\/em> \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 mapping <em>_roles<\/em>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 mapping <em>_roles<\/em> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0445\u044d\u0448 \u0440\u043e\u043b\u0438, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. \u0422\u043e \u0435\u0441\u0442\u044c: \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 _roles \u0445\u044d\u0448 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u043d\u0430\u0441 \u0440\u043e\u043b\u0438, \u0430 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0441\u0435\u0445 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 \u0438 adminRole &#8212; \u0445\u044d\u0448 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u0440\u043e\u043b\u0438, \u0435\u0451 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c <em>members.<\/em><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0445\u044d\u0448 \u0434\u043b\u044f \u0438\u043c\u043f\u0440\u043e\u0432\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f <em>ADMIN_ROLE<\/em>, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044e keccak256 \u0441\u0442\u0440\u043e\u043a\u0443 &#171;ADMIN_ROLE&#187;:<\/p>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity =0.8.9;  import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract A is AccessControl {    \/\/ \u0415\u0441\u043b\u0438 \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u043d\u0435\u0439,   \/\/ \u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \"0xa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775\"   \/\/ \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0445\u044d\u0448 \u0440\u043e\u043b\u0438   bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");      \/\/ \u0435\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a DEFAULT_ADMIN_ROLE, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0432 AccessControl,   \/\/ \u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \"0x0000000000000000000000000000000000000000000000000000000000000000\" }<\/code><\/pre>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u043b\u0438 \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435? \u041d\u0435\u0442, \u043d\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0432\u0430\u043c \u0436\u0438\u0437\u043d\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u0445\u044d\u0448 \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432 \u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0432\u043e\u0438\u0445 \u0441\u0438\u043b, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c(\u043e\u0431 \u044d\u0442\u043e\u043c \u0435\u0449\u0451 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u043d\u043e).<\/p>\n<h2>\u0412\u043d\u0435\u0448\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 AccessControl<\/h2>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 <em>public<\/em>, \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c(<em>internal<\/em>) \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0438 \u0438\u0445 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043c\u044b \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f.<\/p>\n<ol>\n<li>\n<p>\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>onlyRole(bytes32 role)<\/em> &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u043a\u0430\u043a\u043e\u0439 \u0440\u043e\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {     \/\/ \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u043e\u043a\u0435\u043d \u0441\u0442\u043d\u0434\u0430\u0440\u0442\u0430 ERC-20 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0447\u0435\u043a\u0430\u043d\u0438\u0442\u044c \u043c\u043e\u043d\u0435\u0442\u044b      \/\/ \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0440\u043e\u043b\u044c \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0447\u0435\u043a\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043c\u043e\u043d\u0435\u0442\u044b     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         \/\/ \u0434\u0430\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u0440\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0440\u043e\u043b\u044c DEFAULT_ADMIN_ROLE         \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043f\u043b\u043e\u0435\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE \u0434\u0440\u0443\u0433\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);     }       \/\/ \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 onlyRole(MINTER_ROLE)     \/\/ \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e mint \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c MINTER_ROLE     function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {         _mint(to, amount);     } }<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p><em>supportsInterface(bytes4 interfaceId) <\/em>&#8212; \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a \u0442\u0435\u043c\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0435\u0451 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c <a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-165\" rel=\"noopener noreferrer nofollow\">EIP-165<\/a>.<\/p>\n<\/li>\n<li>\n<p><em>hasRole(bytes32 role, address account)<\/em> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442<em> true\/false <\/em>\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u0430\u0434\u0440\u0435\u0441\u0430(\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>account<\/em>) \u044d\u0442\u0430<em> <\/em>\u0440\u043e\u043b\u044c(\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442<em> role<\/em>), \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 <em>onlyRole<\/em>, \u043b\u0438\u0431\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0440\u043e\u043b\u044c\u044e. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <em>hasRole<\/em> \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0440\u043e\u043b\u044c.<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {     \/\/ \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0440\u043e\u043b\u044c \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0447\u0435\u043a\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043c\u043e\u043d\u0435\u0442\u044b     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         \/\/ \u0434\u0430\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u0440\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0440\u043e\u043b\u044c DEFAULT_ADMIN_ROLE         \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043f\u043b\u043e\u0435\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE \u0434\u0440\u0443\u0433\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);     }       function mint(address to, uint256 amount) public {         \/\/ hasRole \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 require true\/false,          \/\/ \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f         \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f, \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441          \/\/ \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \"You are not a minter.\" \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e         require(             hasRole(MINTER_ROLE, msg.sender),              \"You are not a minter.\"         );         _mint(to, amount);     } }<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p><em>getRoleAdmin(bytes32 role) <\/em>&#8212;<em> <\/em>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0445\u044d\u0448 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u0440\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442(<em>role<\/em>)<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {     \/\/ \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0445\u044d\u0448 \"0xa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775\"     bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");     \/\/ \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0445\u044d\u0448 \"0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6\"     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");     \/\/ \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0445\u044d\u0448 \"0x3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848\"     bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         \/\/ \u0434\u0430\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u0440\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0440\u043e\u043b\u044c DEFAULT_ADMIN_ROLE         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);          \/\/ \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0440\u043e\u043b\u0438 BURNER_ROLE         \/\/ \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 ADMIN_ROLE         \/\/ \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c\/\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0445 BURNER_ROLE         _setRoleAdmin(BURNER_ROLE, ADMIN_ROLE);         \/\/ \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043c\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 _setRoleAdmin \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f BURNER_ROLE         \/\/ \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE, \u0441\u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c DEFAULT_ADMIN_ROLE     }       \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c MINTER_ROLE     function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {         _mint(to, amount);     }      \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c BURNER_ROLE     function burn(address to, uint256 amount) public onlyRole(BURNER_ROLE) {         _burn(to, amount);     } }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <em>getRoleAdmin(<\/em>0x0000000000000000000000000000000000000000000000000000000000000000<em>), \u0442\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0445\u044d\u0448 \u0440\u043e\u043b\u0438 <\/em>DEFAULT_ADMIN_ROLE, \u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043c 0x0000000000000000000000000000000000000000000000000000000000000000, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e DEFAULT_ADMIN_ROLE \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u043e\u043b\u0435\u0439, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u0431\u044b\u043b \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u0445\u044d\u0448\u0430 \u0431\u0443\u0434\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u0442\u043e\u0442 \u0445\u044d\u0448 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p><em>getRoleAdmin(ADMIN_ROLE) -> DEFAULT_ADMIN_ROLE<\/em>, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 \u043c\u044b \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p><em>getRoleAdmin(MINTER_ROLE) -> DEFAULT_ADMIN_ROLE<\/em>, \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448 \u0432 \u043e\u0442\u0432\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0432\u044b\u0448\u0435(\u0434\u043b\u044f <em>ADMIN_ROLE<\/em>)<\/p>\n<\/li>\n<li>\n<p><em>getRoleAdmin(BURNER_ROLE) -> ADMIN_ROL<\/em>E, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>getRoleAdmin <\/em>\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043e\u0442, \u043c\u043e\u043b, \u0434\u043b\u044f<em> BURNER_ROLE<\/em> \u0430\u0434\u043c\u0438\u043d \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 <em>ADMIN_ROLE<\/em>, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 <em>DEFAULT_ADMIN_ROLE<\/em>? \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043c\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 <em>_setRoleAdmin(BURNER_ROLE, ADMIN_ROLE).<\/em><\/p>\n<\/li>\n<\/ul>\n<ol start=\"5\">\n<li>\n<p> <em>grantRole(bytes32 role, address account) &#8212; <\/em>\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0430\u044e\u0449\u0430\u044f \u0440\u043e\u043b\u044c(<em>role<\/em>) \u0430\u0434\u0440\u0435\u0441\u0443(<em>account<\/em>), \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0440\u043e\u043b\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a <em>role<\/em>, \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {          bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");     bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);          \/\/ \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0440\u043e\u043b\u0438 BURNER_ROLE         \/\/ \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 ADMIN_ROLE         \/\/ \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c\/\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0445 BURNER_ROLE         _setRoleAdmin(BURNER_ROLE, ADMIN_ROLE);         \/\/ \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043c\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 _setRoleAdmin \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f BURNER_ROLE         \/\/ \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE, \u0441\u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c DEFAULT_ADMIN_ROLE     }       \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c MINTER_ROLE     function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {         _mint(to, amount);     }      \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c BURNER_ROLE     function burn(address to, uint256 amount) public onlyRole(BURNER_ROLE) {         _burn(to, amount);     } }<\/code><\/pre>\n<ul>\n<li>\n<p>\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0443 <em>address1<\/em> \u0440\u043e\u043b\u044c <em>ADMIN_ROLE<\/em>, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c <em>DEFAULT_ADMIN_ROLE<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0437\u0432\u0430\u0442\u044c <em>grantRole(address1, ADMIN_ROLE)<\/em>, \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 <em>address<\/em>1 \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u043e\u043b\u0438 <em>ADMIN_ROLE<\/em><\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043f\u0435\u0440\u044c, <em>address1<\/em> \u0445\u043e\u0447\u0435\u0442 \u0434\u0430\u0442\u044c \u0440\u043e\u043b\u044c <em>BURNER_ROLE<\/em> \u0430\u0434\u0440\u0435\u0441\u0443 <em>address2<\/em>, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0443\u043d\u043a\u0442\u0435 \u0432\u044b\u0448\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c <em>DEFAULT_ADMIN_ROLE<\/em> \u0434\u0430\u043b \u0440\u043e\u043b\u044c <em>ADMIN_ROLE<\/em> \u0430\u0434\u0440\u0435\u0441\u0443 <em>address1<\/em>. \u0410\u0434\u0440\u0435\u0441 <em>address1<\/em> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <em>grantRole(address2, BURNER_ROLE)<\/em>, \u0442\u0435\u043f\u0435\u0440\u044c \u0430\u0434\u0440\u0435\u0441 <em>address2<\/em> \u0441\u0442\u0430\u043b \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u0435\u043c \u0440\u043e\u043b\u0438 <em>BURNER_ROLE<\/em>. <\/p>\n<\/li>\n<\/ul>\n<ol start=\"6\">\n<li>\n<p><em>revokeRole(bytes32 role, address account) &#8212; <\/em>\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f <em>grantRole<\/em>, \u0435\u0441\u043b\u0438 <em>grantRole <\/em>\u043a\u043e\u043c\u0443-\u0442\u043e \u0434\u0430\u0435\u0442 \u0440\u043e\u043b\u044c,<em> \u0442\u043e revokeRole<\/em>, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442<em>.<\/em><\/p>\n<\/li>\n<li>\n<p><em>renounceRole(bytes32 role, address account) &#8212; <\/em>\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u0430 \u043e\u0442 \u0440\u043e\u043b\u0438, \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0440\u043e\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0451 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <em>account<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0430\u0434\u0440\u0435\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u0441\u044f \u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &#171;AccessControl: can only renounce roles for self&#187;, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0433\u0434\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {      bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");          constructor() ERC20(\"Some token\", \"STKN\") {         \/\/ \u043a\u043e\u0433\u0434\u0430 \u044f \u0431\u0443\u0434\u0443 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0432 \u0441\u0435\u0442\u044c, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u0441\u0435\u0431\u044f \u0430\u0434\u043c\u0438\u043d\u043e\u043c         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);         \/\/ \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u044f \u043c\u043e\u0433\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0445 MINTER_ROLE     }       \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c MINTER_ROLE     function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {         _mint(to, amount);     }      \/\/ \u043a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0440\u043e\u043b\u0438:     \/\/ DEFAULT_ADMIN_ROLE - \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0445 MINTER_ROLE     \/\/ MINTER_ROLE - \u043f\u0440\u0430\u0432\u043e \u0447\u0435\u043a\u0430\u043d\u0438\u0442\u044c \u043c\u043e\u043d\u0435\u0442\u044b     \/\/ \u043d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 \u044f \u0445\u043e\u0447\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435      \/\/ \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443,     \/\/ \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u0434\u0435\u043b\u0430\u044e \u044d\u0442\u043e\u0442 \u0442\u043e\u043a\u0435\u043d     \/\/ \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0433\u043e DEFAULT_ADMIN_ROLE     \/\/ \u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a:     \/\/ grantRole(DEFAULT_ADMIN_ROLE, customerAccount)     \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044f DEFAULT_ADMIN_ROLE: \u044f \u0438 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a     \/\/ \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 \u0440\u043e\u043b\u0438 DEFAULT_ADMIN_ROLE:     \/\/ renounceRole(DEFAULT_ADMIN_ROLE, myAccount)     \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043e\u0434\u0438\u043d DEFAULT_ADMIN_ROLE - \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a }<\/code><\/pre>\n<h2>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 AccessControl<\/h2>\n<p>\u0412\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0438\u043c\u0435\u043b\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 <em>public<\/em>, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0443\u0434\u0430 \u0443\u0433\u043e\u0434\u043d\u043e. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0432\u0441\u0435 \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 <em>internal, <\/em>\u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u043b\u0438\u0431\u043e \u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u0439 \u043e\u0442 AccessControl.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437\u043d\u0443\u0442\u0440\u0438, \u0437\u0430\u043e\u0434\u043d\u043e \u043f\u043e\u0439\u043c\u0435\u043c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f storage AccessControl<\/p>\n<ol>\n<li>\n<p><em>_checkRole(bytes32 role)<\/em> &#8212; \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u044c\u044e <em>role<\/em><\/p>\n<\/li>\n<\/ol>\n<pre><code>function _checkRole(bytes32 role) internal view virtual {     \/\/ \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0430\u044f _checkRole, \u043d\u043e \u043e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0443\u0436\u0435 \u0434\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430     \/\/ \u0440\u043e\u043b\u044c \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0441 \u0430\u0434\u0440\u0435\u0441     _checkRole(role, _msgSender());  }<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p><em>_checkRole(bytes32 role, address account)<\/em> &#8212; \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 <em>account<\/em> \u0440\u043e\u043b\u044c\u044e <em>role<\/em>:<\/p>\n<\/li>\n<\/ol>\n<pre><code>function _checkRole(bytes32 role, address account) internal view virtual {     \/\/ \u0432 if \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0443 account \u043d\u0435\u0442 role,      \/\/ \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043a\u0446\u0438\u0438 \u0438\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435, \u043c\u0438\u043d\u0443\u044f \u0431\u043b\u043e\u043a if     if (!hasRole(role, account)) {          \/\/ \u0435\u0441\u043b\u0438 \u0440\u043e\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0432\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c         \/\/ \"AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})\"         revert(              string(                 abi.encodePacked(                     \"AccessControl: account \",                     Strings.toHexString(uint160(account), 20),                     \" is missing role \",                     Strings.toHexString(uint256(role), 32)                 )             )         );     } }<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p><em>_setupRole(bytes32 role, address account)<\/em> &#8212; \u0442\u043e\u0442 \u0436\u0435 \u0441\u043c\u044b\u0441\u043b, \u0447\u0442\u043e \u0438 <em>grantRole<\/em>, \u043d\u043e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435:<\/p>\n<\/li>\n<\/ol>\n<pre><code>function _setupRole(bytes32 role, address account) internal virtual {     _grantRole(role, account); }<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p><em>_setRoleAdmin(bytes32 role, bytes32 adminRole)<\/em> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430(<em>adminRole<\/em>) \u0434\u043b\u044f \u0440\u043e\u043b\u0438(<em>role<\/em>):<\/p>\n<\/li>\n<\/ol>\n<pre><code>function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {     \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0430     bytes32 previousAdminRole = getRoleAdmin(role);      \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0430 \u0434\u043b\u044f \u0440\u043e\u043b\u0438 role     _roles[role].adminRole = adminRole;     \/\/ \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e \u0441\u043c\u0435\u043d\u0435 \u0430\u0434\u043c\u0438\u043d\u0430     emit RoleAdminChanged(role, previousAdminRole, adminRole); }<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p><em>_grantRole(bytes32 role, address account)<\/em> &#8212; \u0434\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0443 <em>account<\/em> \u0440\u043e\u043b\u044c <em>role<\/em>:<\/p>\n<\/li>\n<\/ol>\n<pre><code>function _grantRole(bytes32 role, address account) internal virtual {     \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0443 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u0442 \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438,      \/\/ \u0447\u0442\u043e\u0431\u044b \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0442\u044b \u043f\u0430\u043c\u044f\u0442\u0438     if (!hasRole(role, account)) {         \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0432 \u0447\u0438\u0441\u043b\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u043e\u043b\u0438 role         _roles[role].members[account] = true;         emit RoleGranted(role, account, _msgSender());     } }<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p><em>_revokeRole(bytes32 role, address account)<\/em> &#8212; \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0443 \u0430\u0434\u0440\u0435\u0441\u0430 <em>account<\/em> \u0440\u043e\u043b\u044c <em>role<\/em>:<\/p>\n<\/li>\n<\/ol>\n<pre><code>function _revokeRole(bytes32 role, address account) internal virtual {     \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0443 \u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u0441\u0442\u044c \u044d\u0442\u0430 \u0440\u043e\u043b\u044c,      \/\/ \u0447\u0442\u043e\u0431\u044b \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0442\u044b \u043f\u0430\u043c\u044f\u0442\u0438     if (hasRole(role, account)) {         \/\/ \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 account \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u043e\u043b\u0438 role         _roles[role].members[account] = false;         emit RoleRevoked(role, account, _msgSender());     } }<\/code><\/pre>\n<h2>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u041e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b? \u0421 \u0447\u0435\u043c-\u0442\u043e \u043d\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b? \u041f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u043e\u0439: 0x021Db128ceab47C66419990ad95b3b180dF3f91F<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/691274\/\"> https:\/\/habr.com\/ru\/post\/691274\/<\/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>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u043a AccessControl \u043e\u0442 OpenZeppelin, \u0434\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 \u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u0443\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430\u0445 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e.<\/p>\n<p>\u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u043b\u0438, \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0440\u043e\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0438 \u0434\u0430\u0436\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u043e\u043b\u0438. \u042d\u0442\u043e \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0439, \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0443\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043a \u0434\u0435\u043b\u0443!<\/p>\n<p>\u0414\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0442\u043a\u0440\u044b\u0442\u044c <a href=\"https:\/\/github.com\/OpenZeppelin\/openzeppelin-contracts\/blob\/master\/contracts\/access\/AccessControl.sol\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a> \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u043e\u043b\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435<\/h2>\n<figure class=\"full-width\"><figcaption>\u041f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 AccessControl \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <em>RoleData<\/em> &#8212; \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0440\u043e\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>mapping <em>members<\/em> &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0440\u043e\u043b\u044c\u044e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f <em>true\/false<\/em>;<\/p>\n<\/li>\n<li>\n<p><em>adminRole<\/em> &#8212; \u0437\u0434\u0435\u0441\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0445\u044d\u0448 \u0440\u043e\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430 \u0440\u043e\u043b\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c <em>adminRole<\/em>, \u0442\u043e \u044f \u043c\u043e\u0433\u0443 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 mapping <em>members<\/em>, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0442\u043e \u0432 \u0441\u043b\u043e\u0442\u0435 <em>adminRole<\/em> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448(0x0000000000000000000000000000000000000000000000000000000000000000), \u0442\u043e \u0435\u0441\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 <em>DEFAULT_ADMIN_ROLE<\/em>. \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e <em>DEFAULT_ADMIN_ROLE<\/em>? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 57.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>RoleData<\/em> \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 mapping <em>_roles<\/em>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 mapping <em>_roles<\/em> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0445\u044d\u0448 \u0440\u043e\u043b\u0438, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. \u0422\u043e \u0435\u0441\u0442\u044c: \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 _roles \u0445\u044d\u0448 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u043d\u0430\u0441 \u0440\u043e\u043b\u0438, \u0430 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0441\u0435\u0445 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 \u0438 adminRole &#8212; \u0445\u044d\u0448 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u0440\u043e\u043b\u0438, \u0435\u0451 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c <em>members.<\/em><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0445\u044d\u0448 \u0434\u043b\u044f \u0438\u043c\u043f\u0440\u043e\u0432\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f <em>ADMIN_ROLE<\/em>, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044e keccak256 \u0441\u0442\u0440\u043e\u043a\u0443 &#171;ADMIN_ROLE&#187;:<\/p>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity =0.8.9;  import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract A is AccessControl {    \/\/ \u0415\u0441\u043b\u0438 \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u043d\u0435\u0439,   \/\/ \u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \"0xa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775\"   \/\/ \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0445\u044d\u0448 \u0440\u043e\u043b\u0438   bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");      \/\/ \u0435\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a DEFAULT_ADMIN_ROLE, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0432 AccessControl,   \/\/ \u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \"0x0000000000000000000000000000000000000000000000000000000000000000\" }<\/code><\/pre>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u043b\u0438 \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435? \u041d\u0435\u0442, \u043d\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0432\u0430\u043c \u0436\u0438\u0437\u043d\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u0445\u044d\u0448 \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432 \u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0432\u043e\u0438\u0445 \u0441\u0438\u043b, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c(\u043e\u0431 \u044d\u0442\u043e\u043c \u0435\u0449\u0451 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u043d\u043e).<\/p>\n<h2>\u0412\u043d\u0435\u0448\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 AccessControl<\/h2>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 <em>public<\/em>, \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c(<em>internal<\/em>) \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0438 \u0438\u0445 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043c\u044b \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f.<\/p>\n<ol>\n<li>\n<p>\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>onlyRole(bytes32 role)<\/em> &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u043a\u0430\u043a\u043e\u0439 \u0440\u043e\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {     \/\/ \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u043e\u043a\u0435\u043d \u0441\u0442\u043d\u0434\u0430\u0440\u0442\u0430 ERC-20 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0447\u0435\u043a\u0430\u043d\u0438\u0442\u044c \u043c\u043e\u043d\u0435\u0442\u044b      \/\/ \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0440\u043e\u043b\u044c \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0447\u0435\u043a\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043c\u043e\u043d\u0435\u0442\u044b     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         \/\/ \u0434\u0430\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u0440\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0440\u043e\u043b\u044c DEFAULT_ADMIN_ROLE         \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043f\u043b\u043e\u0435\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE \u0434\u0440\u0443\u0433\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);     }       \/\/ \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 onlyRole(MINTER_ROLE)     \/\/ \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e mint \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c MINTER_ROLE     function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {         _mint(to, amount);     } }<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p><em>supportsInterface(bytes4 interfaceId) <\/em>&#8212; \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a \u0442\u0435\u043c\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0435\u0451 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c <a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-165\" rel=\"noopener noreferrer nofollow\">EIP-165<\/a>.<\/p>\n<\/li>\n<li>\n<p><em>hasRole(bytes32 role, address account)<\/em> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442<em> true\/false <\/em>\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u0430\u0434\u0440\u0435\u0441\u0430(\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>account<\/em>) \u044d\u0442\u0430<em> <\/em>\u0440\u043e\u043b\u044c(\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442<em> role<\/em>), \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 <em>onlyRole<\/em>, \u043b\u0438\u0431\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0440\u043e\u043b\u044c\u044e. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <em>hasRole<\/em> \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0440\u043e\u043b\u044c.<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {     \/\/ \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0440\u043e\u043b\u044c \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0447\u0435\u043a\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043c\u043e\u043d\u0435\u0442\u044b     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         \/\/ \u0434\u0430\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u0440\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0440\u043e\u043b\u044c DEFAULT_ADMIN_ROLE         \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043f\u043b\u043e\u0435\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE \u0434\u0440\u0443\u0433\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);     }       function mint(address to, uint256 amount) public {         \/\/ hasRole \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 require true\/false,          \/\/ \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f         \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f, \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441          \/\/ \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \"You are not a minter.\" \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e         require(             hasRole(MINTER_ROLE, msg.sender),              \"You are not a minter.\"         );         _mint(to, amount);     } }<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p><em>getRoleAdmin(bytes32 role) <\/em>&#8212;<em> <\/em>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0445\u044d\u0448 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u0440\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442(<em>role<\/em>)<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {     \/\/ \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0445\u044d\u0448 \"0xa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775\"     bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");     \/\/ \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0445\u044d\u0448 \"0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6\"     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");     \/\/ \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0445\u044d\u0448 \"0x3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848\"     bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         \/\/ \u0434\u0430\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u0440\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0440\u043e\u043b\u044c DEFAULT_ADMIN_ROLE         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);          \/\/ \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0440\u043e\u043b\u0438 BURNER_ROLE         \/\/ \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 ADMIN_ROLE         \/\/ \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c\/\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0445 BURNER_ROLE         _setRoleAdmin(BURNER_ROLE, ADMIN_ROLE);         \/\/ \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043c\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 _setRoleAdmin \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f BURNER_ROLE         \/\/ \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE, \u0441\u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c DEFAULT_ADMIN_ROLE     }       \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c MINTER_ROLE     function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {         _mint(to, amount);     }      \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c BURNER_ROLE     function burn(address to, uint256 amount) public onlyRole(BURNER_ROLE) {         _burn(to, amount);     } }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <em>getRoleAdmin(<\/em>0x0000000000000000000000000000000000000000000000000000000000000000<em>), \u0442\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0445\u044d\u0448 \u0440\u043e\u043b\u0438 <\/em>DEFAULT_ADMIN_ROLE, \u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043c 0x0000000000000000000000000000000000000000000000000000000000000000, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e DEFAULT_ADMIN_ROLE \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u043e\u043b\u0435\u0439, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u0431\u044b\u043b \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u0445\u044d\u0448\u0430 \u0431\u0443\u0434\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u0442\u043e\u0442 \u0445\u044d\u0448 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p><em>getRoleAdmin(ADMIN_ROLE) -> DEFAULT_ADMIN_ROLE<\/em>, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 \u043c\u044b \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p><em>getRoleAdmin(MINTER_ROLE) -> DEFAULT_ADMIN_ROLE<\/em>, \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0445\u044d\u0448 \u0432 \u043e\u0442\u0432\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0432\u044b\u0448\u0435(\u0434\u043b\u044f <em>ADMIN_ROLE<\/em>)<\/p>\n<\/li>\n<li>\n<p><em>getRoleAdmin(BURNER_ROLE) -> ADMIN_ROL<\/em>E, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>getRoleAdmin <\/em>\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043e\u0442, \u043c\u043e\u043b, \u0434\u043b\u044f<em> BURNER_ROLE<\/em> \u0430\u0434\u043c\u0438\u043d \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 <em>ADMIN_ROLE<\/em>, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 <em>DEFAULT_ADMIN_ROLE<\/em>? \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043c\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 <em>_setRoleAdmin(BURNER_ROLE, ADMIN_ROLE).<\/em><\/p>\n<\/li>\n<\/ul>\n<ol start=\"5\">\n<li>\n<p> <em>grantRole(bytes32 role, address account) &#8212; <\/em>\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0430\u044e\u0449\u0430\u044f \u0440\u043e\u043b\u044c(<em>role<\/em>) \u0430\u0434\u0440\u0435\u0441\u0443(<em>account<\/em>), \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0440\u043e\u043b\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a <em>role<\/em>, \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<\/li>\n<\/ol>\n<pre><code>\/\/ SPDX-License-Identifier: MIT pragma solidity 0.8.11;  import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\"; import \"@openzeppelin\/contracts\/access\/AccessControl.sol\";  contract Token is ERC20, AccessControl {          bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");     bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");     bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");      constructor() ERC20(\"Some token\", \"STKN\") {         _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);          \/\/ \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0440\u043e\u043b\u0438 BURNER_ROLE         \/\/ \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c \u0440\u043e\u043b\u0438 ADMIN_ROLE         \/\/ \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c\/\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0445 BURNER_ROLE         _setRoleAdmin(BURNER_ROLE, ADMIN_ROLE);         \/\/ \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043c\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 _setRoleAdmin \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f BURNER_ROLE         \/\/ \u0434\u0430\u0432\u0430\u0442\u044c MINTER_ROLE, \u0441\u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c DEFAULT_ADMIN_ROLE     }       \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c MINTER_ROLE     function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {         _mint(to, amount);     }      \/\/ \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c BURNER_ROLE     function burn(address to, uint256 amount) public onlyRole(BURNER_ROLE) {         _burn(to, amount);     } }<\/code><\/pre>\n<ul>\n<li>\n<p>\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0443 <em>address1<\/em> \u0440\u043e\u043b\u044c <em>ADMIN_ROLE<\/em>, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c <em>DEFAULT_ADMIN_ROLE<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0437\u0432\u0430\u0442\u044c <em>grantRole(address1, ADMIN_ROLE)<\/em>, \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 <em>address<\/em>1 \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u043e\u043b\u0438 <em>ADMIN_ROLE<\/em><\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043f\u0435\u0440\u044c, <em>address1<\/em> \u0445\u043e\u0447\u0435\u0442 \u0434\u0430\u0442\u044c \u0440\u043e\u043b\u044c <em>BURNER_ROLE<\/em> \u0430\u0434\u0440\u0435\u0441\u0443 <em>address2<\/em>, <\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-339241","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339241","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=339241"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339241\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}