{"id":7104,"date":"2023-03-29T08:52:10","date_gmt":"2023-03-29T08:52:10","guid":{"rendered":"https:\/\/ai.catenacap.xyz\/?page_id=7104"},"modified":"2023-03-29T09:39:48","modified_gmt":"2023-03-29T09:39:48","slug":"restrict-us-wallet-validation-on-evm-protocol-comibined","status":"publish","type":"page","link":"https:\/\/ai.catenacap.xyz\/?page_id=7104","title":{"rendered":"Restrict US Wallet Validation on EVM Protocol Comibined."},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"7104\" class=\"elementor elementor-7104\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5a79d81e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5a79d81e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2b92cc27\" data-id=\"2b92cc27\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0eca513 elementor-widget elementor-widget-heading\" data-id=\"0eca513\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Restrict US Wallet &amp; Node Validation at EMV Smart Contract Level.<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2179c91 elementor-widget elementor-widget-text-editor\" data-id=\"2179c91\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Restrict US Wallet(s) and Validator(s) from interacting with a EVM smart contract.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>The following restricts Nodes in the US (other also)\u00a0<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/catenacap\/restrict_evm_US_other_validation\">https:\/\/github.com\/catenacap\/restrict_evm_US_other_validation<\/a>\u00a0<\/li>\n<\/ul>\n<p>The following restricts Wallets in the US (other also)\u00a0<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/catenacap\/restrict_EVM_US_other_Wallets_Via_Smartcontracts\/blob\/main\/README.md\">https:\/\/github.com\/catenacap\/restrict_EVM_US_other_Wallets_Via_Smartcontracts\/<\/a><\/li>\n<\/ul>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>Below you will find an alternative that restricts both US based wallets from interacting with the smart contract, or to restrict US nodes from validating any transaction for your smart contract.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b26f79e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b26f79e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8d140fc\" data-id=\"8d140fc\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1fe16f3 elementor-widget elementor-widget-code-highlight\" data-id=\"1fe16f3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>pragma solidity ^0.8.0;\n\ncontract USRestriction { mapping (address => string) private _walletCountry; mapping (address => string) private _nodeCountry;\n\nmodifier onlyNonUS() {\n    string memory walletCountry = _walletCountry[msg.sender];\n    string memory nodeCountry = _nodeCountry[tx.origin];\n    require(keccak256(bytes(walletCountry)) != keccak256(bytes(\"United States\")) &&\n            keccak256(bytes(nodeCountry)) != keccak256(bytes(\"United States\")), \"US-based access detected.\");\n    _;\n}\n\nfunction updateWalletCountryMapping(address wallet, string memory country) public {\n    _walletCountry[wallet] = country;\n}\n\nfunction updateNodeCountryMapping(address node, string memory country) public {\n    _nodeCountry[node] = country;\n}\n\nfunction myRestrictedFunction() public onlyNonUS {\n    \/\/ This function can only be called from wallets owned by individuals located outside the United States\n    \/\/ and validator nodes\/miners located outside the United States\n    \/\/ ...\n}\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-13cafa4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"13cafa4\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-64b4702\" data-id=\"64b4702\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-85c68ed elementor-widget elementor-widget-text-editor\" data-id=\"85c68ed\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p dir=\"auto\">The <strong>USRestriction<\/strong> contract combines the previous examples to restrict access to both US-based wallets and US-based validator nodes\/miners.<\/p>\n<p dir=\"auto\">The <strong>_walletCountry<\/strong> and <strong>_nodeCountry<\/strong> mappings associate wallet addresses and node addresses with their corresponding countries, respectively. You can update these mappings using the <strong>updateWalletCountryMapping<\/strong> and <strong>updateNodeCountryMapping<\/strong> functions, which take an address and a country as parameters.<\/p>\n<p dir=\"auto\">The <strong>onlyNonUS<\/strong> modifier checks the country of origin of the wallet owner and the validator node\/miner based on the <strong>_walletCountry<\/strong> and <strong>_nodeCountry<\/strong> mappings, respectively. If either the wallet or the node is detected as being located in the United States, the modifier reverts the transaction and prevents the function from being executed.<\/p>\n<p dir=\"auto\">The <strong>myRestrictedFunction<\/strong> function is an example of a function that is restricted to non-US wallets and non-US validator nodes\/miners. It can only be called from wallets owned by individuals located outside the United States and validator nodes\/miners located outside the United States.<\/p>\n<p dir=\"auto\">As with the previous examples, keep in mind that this approach relies on the accuracy and reliability of the external APIs used to retrieve the country information.<\/p>\n<p dir=\"auto\">Visit our <a href=\"https:\/\/github.com\/catenacap\/restrict_evm_US_other_validation\" target=\"_blank\" rel=\"noopener\">Github<\/a>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Restrict US Wallet &amp; Node Validation at EMV Smart Contract Level. Restrict US Wallet(s) and Validator(s) from interacting with a EVM smart contract. The following restricts Nodes in the US (other also)\u00a0 https:\/\/github.com\/catenacap\/restrict_evm_US_other_validation\u00a0 The following restricts Wallets in the US (other also)\u00a0 https:\/\/github.com\/catenacap\/restrict_EVM_US_other_Wallets_Via_Smartcontracts\/ Below you will find an alternative that restricts both US based wallets [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_theme","meta":{"_acf_changed":false,"disable_featured_image":false,"footnotes":""},"class_list":["post-7104","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Restrict US Wallet Validation on EVM Protocol Comibined. - AI | Catena Cap<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ai.catenacap.xyz\/?page_id=7104\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Restrict US Wallet Validation on EVM Protocol Comibined. - AI | Catena Cap\" \/>\n<meta property=\"og:description\" content=\"Restrict US Wallet &amp; Node Validation at EMV Smart Contract Level. Restrict US Wallet(s) and Validator(s) from interacting with a EVM smart contract. The following restricts Nodes in the US (other also)\u00a0 https:\/\/github.com\/catenacap\/restrict_evm_US_other_validation\u00a0 The following restricts Wallets in the US (other also)\u00a0 https:\/\/github.com\/catenacap\/restrict_EVM_US_other_Wallets_Via_Smartcontracts\/ Below you will find an alternative that restricts both US based wallets [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ai.catenacap.xyz\/?page_id=7104\" \/>\n<meta property=\"og:site_name\" content=\"AI | Catena Cap\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-29T09:39:48+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@CatenaCap\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7104\",\"url\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7104\",\"name\":\"Restrict US Wallet Validation on EVM Protocol Comibined. - AI | Catena Cap\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/#website\"},\"datePublished\":\"2023-03-29T08:52:10+00:00\",\"dateModified\":\"2023-03-29T09:39:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7104#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7104\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7104#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ai.catenacap.xyz\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Restrict US Wallet Validation on EVM Protocol Comibined.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/#website\",\"url\":\"https:\\\/\\\/ai.catenacap.xyz\\\/\",\"name\":\"AI | Catena Cap\",\"description\":\"Don&#039;t Trust, Verify\",\"publisher\":{\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/#organization\",\"name\":\"AI | CatenaCap\",\"url\":\"https:\\\/\\\/ai.catenacap.xyz\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/bafybeihf3j3elacorgnhodcdk4nnenm63rag6p777elx52d5xwpkmm5rfi.ipfs.dweb.link\\\/uploads\\\/2023\\\/02\\\/occ-fav-150x150-1.png\",\"contentUrl\":\"https:\\\/\\\/bafybeihf3j3elacorgnhodcdk4nnenm63rag6p777elx52d5xwpkmm5rfi.ipfs.dweb.link\\\/uploads\\\/2023\\\/02\\\/occ-fav-150x150-1.png\",\"width\":150,\"height\":150,\"caption\":\"AI | CatenaCap\"},\"image\":{\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/CatenaCap\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Restrict US Wallet Validation on EVM Protocol Comibined. - AI | Catena Cap","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ai.catenacap.xyz\/?page_id=7104","og_locale":"en_US","og_type":"article","og_title":"Restrict US Wallet Validation on EVM Protocol Comibined. - AI | Catena Cap","og_description":"Restrict US Wallet &amp; Node Validation at EMV Smart Contract Level. Restrict US Wallet(s) and Validator(s) from interacting with a EVM smart contract. The following restricts Nodes in the US (other also)\u00a0 https:\/\/github.com\/catenacap\/restrict_evm_US_other_validation\u00a0 The following restricts Wallets in the US (other also)\u00a0 https:\/\/github.com\/catenacap\/restrict_EVM_US_other_Wallets_Via_Smartcontracts\/ Below you will find an alternative that restricts both US based wallets [&hellip;]","og_url":"https:\/\/ai.catenacap.xyz\/?page_id=7104","og_site_name":"AI | Catena Cap","article_modified_time":"2023-03-29T09:39:48+00:00","twitter_card":"summary_large_image","twitter_site":"@CatenaCap","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/ai.catenacap.xyz\/?page_id=7104","url":"https:\/\/ai.catenacap.xyz\/?page_id=7104","name":"Restrict US Wallet Validation on EVM Protocol Comibined. - AI | Catena Cap","isPartOf":{"@id":"https:\/\/ai.catenacap.xyz\/#website"},"datePublished":"2023-03-29T08:52:10+00:00","dateModified":"2023-03-29T09:39:48+00:00","breadcrumb":{"@id":"https:\/\/ai.catenacap.xyz\/?page_id=7104#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ai.catenacap.xyz\/?page_id=7104"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ai.catenacap.xyz\/?page_id=7104#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ai.catenacap.xyz\/"},{"@type":"ListItem","position":2,"name":"Restrict US Wallet Validation on EVM Protocol Comibined."}]},{"@type":"WebSite","@id":"https:\/\/ai.catenacap.xyz\/#website","url":"https:\/\/ai.catenacap.xyz\/","name":"AI | Catena Cap","description":"Don&#039;t Trust, Verify","publisher":{"@id":"https:\/\/ai.catenacap.xyz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ai.catenacap.xyz\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ai.catenacap.xyz\/#organization","name":"AI | CatenaCap","url":"https:\/\/ai.catenacap.xyz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ai.catenacap.xyz\/#\/schema\/logo\/image\/","url":"https:\/\/bafybeihf3j3elacorgnhodcdk4nnenm63rag6p777elx52d5xwpkmm5rfi.ipfs.dweb.link\/uploads\/2023\/02\/occ-fav-150x150-1.png","contentUrl":"https:\/\/bafybeihf3j3elacorgnhodcdk4nnenm63rag6p777elx52d5xwpkmm5rfi.ipfs.dweb.link\/uploads\/2023\/02\/occ-fav-150x150-1.png","width":150,"height":150,"caption":"AI | CatenaCap"},"image":{"@id":"https:\/\/ai.catenacap.xyz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CatenaCap"]}]}},"_links":{"self":[{"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=\/wp\/v2\/pages\/7104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7104"}],"version-history":[{"count":0,"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=\/wp\/v2\/pages\/7104\/revisions"}],"wp:attachment":[{"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}