{"id":7139,"date":"2023-03-29T10:03:27","date_gmt":"2023-03-29T10:03:27","guid":{"rendered":"https:\/\/ai.catenacap.xyz\/?page_id=7139"},"modified":"2023-03-29T10:37:28","modified_gmt":"2023-03-29T10:37:28","slug":"blacklist-us-based-wallets-via-emb-ip-determiner","status":"publish","type":"page","link":"https:\/\/ai.catenacap.xyz\/?page_id=7139","title":{"rendered":"Blacklist US Based Wallets via EMB IP determiner"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"7139\" class=\"elementor elementor-7139\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4afe9de elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4afe9de\" 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-f330074\" data-id=\"f330074\" 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-48701a7 elementor-widget elementor-widget-heading\" data-id=\"48701a7\" 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\">Permanent solution to a wallet\/Node owner bypassing restrictions.<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3fb19e3 elementor-widget elementor-widget-text-editor\" data-id=\"3fb19e3\" 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>The problem with blocking US based users or nodes comes with various weak points the following is a blacklist function where when it&#8217;s determined a end user is trying to connect from the US, their wallet address is not only blocked from interacting with the smart contract, but they end users wallet becomes blacklisted so they can&#8217;t proceed with a bypass via spoofing or VPN&#8217;s.\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-028c589 elementor-widget elementor-widget-code-highlight\" data-id=\"028c589\" 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 { \n    mapping (address => string) private _walletCountry; \n    mapping (address => string) private _nodeCountry;\n    mapping (address => bool) private _blacklistedWallets;\n\n    modifier 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\n    function updateWalletCountryMapping(address wallet, string memory country) public {\n        _walletCountry[wallet] = country;\n    }\n\n    function updateNodeCountryMapping(address node, string memory country) public {\n        _nodeCountry[node] = country;\n    }\n\n    function blacklistWallet(address wallet) public {\n        _blacklistedWallets[wallet] = true;\n    }\n\n    function isWalletBlacklisted(address wallet) public view returns (bool) {\n        return _blacklistedWallets[wallet];\n    }\n\n    function myRestrictedFunction() public onlyNonUS {\n        require(!_blacklistedWallets[msg.sender], \"Your wallet is blacklisted.\");\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}\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<div class=\"elementor-element elementor-element-bfc0b7b elementor-widget elementor-widget-text-editor\" data-id=\"bfc0b7b\" 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>Improvement on our released <a href=\"https:\/\/ai.catenacap.xyz\/?page_id=7104\">validator-nodes\/wallets restriction contract<\/a>, the following will incorporate the end user Wallet Address\/Node Address and add it to a blacklist function.<\/p><p>In this modified version, we&#8217;ve added a new mapping <code>_blacklist<\/code>, which keeps track of addresses that have been blacklisted. We&#8217;ve also added three new functions: <code>addToBlacklist<\/code>, <code>removeFromBlacklist<\/code>, and <code>isBlacklisted<\/code>.<\/p><p>The <code>addToBlacklist<\/code> function allows the contract owner to add a user&#8217;s wallet address to the blacklist. The <code>removeFromBlacklist<\/code> function allows the contract owner to remove a user&#8217;s address from the blacklist. Finally, the <code>isBlacklisted<\/code> function allows anyone to check whether a specific user&#8217;s address is currently blacklisted.<\/p><p>We&#8217;ve also modified the <code>onlyNonRestricted<\/code> modifier to include a check for whether the user&#8217;s address is in the blacklist. If the user is blacklisted, the modifier will trigger an error message and prevent the execution of the function.<\/p><p>By using this modified version of the contract, the contract owner can add addresses to the blacklist as necessary to comply with regulatory requirements. Once an address is blacklisted, it will not be able to access any of the restricted functions in the contract.<\/p><p>Visit our <a href=\"https:\/\/github.com\/catenacap\/Dertermine-IP-US-Country-EVM-Wallet-Node-Blacklist\/\" 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>Permanent solution to a wallet\/Node owner bypassing restrictions. The problem with blocking US based users or nodes comes with various weak points the following is a blacklist function where when it&#8217;s determined a end user is trying to connect from the US, their wallet address is not only blocked from interacting with the smart contract, [&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-7139","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Blacklist US Based Wallets via EMB IP determiner - 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=7139\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Blacklist US Based Wallets via EMB IP determiner - AI | Catena Cap\" \/>\n<meta property=\"og:description\" content=\"Permanent solution to a wallet\/Node owner bypassing restrictions. The problem with blocking US based users or nodes comes with various weak points the following is a blacklist function where when it&#8217;s determined a end user is trying to connect from the US, their wallet address is not only blocked from interacting with the smart contract, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ai.catenacap.xyz\/?page_id=7139\" \/>\n<meta property=\"og:site_name\" content=\"AI | Catena Cap\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-29T10:37:28+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=7139\",\"url\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7139\",\"name\":\"Blacklist US Based Wallets via EMB IP determiner - AI | Catena Cap\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/#website\"},\"datePublished\":\"2023-03-29T10:03:27+00:00\",\"dateModified\":\"2023-03-29T10:37:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7139#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7139\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ai.catenacap.xyz\\\/?page_id=7139#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ai.catenacap.xyz\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blacklist US Based Wallets via EMB IP determiner\"}]},{\"@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":"Blacklist US Based Wallets via EMB IP determiner - 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=7139","og_locale":"en_US","og_type":"article","og_title":"Blacklist US Based Wallets via EMB IP determiner - AI | Catena Cap","og_description":"Permanent solution to a wallet\/Node owner bypassing restrictions. The problem with blocking US based users or nodes comes with various weak points the following is a blacklist function where when it&#8217;s determined a end user is trying to connect from the US, their wallet address is not only blocked from interacting with the smart contract, [&hellip;]","og_url":"https:\/\/ai.catenacap.xyz\/?page_id=7139","og_site_name":"AI | Catena Cap","article_modified_time":"2023-03-29T10:37:28+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=7139","url":"https:\/\/ai.catenacap.xyz\/?page_id=7139","name":"Blacklist US Based Wallets via EMB IP determiner - AI | Catena Cap","isPartOf":{"@id":"https:\/\/ai.catenacap.xyz\/#website"},"datePublished":"2023-03-29T10:03:27+00:00","dateModified":"2023-03-29T10:37:28+00:00","breadcrumb":{"@id":"https:\/\/ai.catenacap.xyz\/?page_id=7139#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ai.catenacap.xyz\/?page_id=7139"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ai.catenacap.xyz\/?page_id=7139#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ai.catenacap.xyz\/"},{"@type":"ListItem","position":2,"name":"Blacklist US Based Wallets via EMB IP determiner"}]},{"@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\/7139","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=7139"}],"version-history":[{"count":0,"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=\/wp\/v2\/pages\/7139\/revisions"}],"wp:attachment":[{"href":"https:\/\/ai.catenacap.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}