{"id":1684,"date":"2023-06-20T12:47:23","date_gmt":"2023-06-20T11:47:23","guid":{"rendered":"https:\/\/dovu.earth\/?p=1684"},"modified":"2024-12-16T14:48:57","modified_gmt":"2024-12-16T13:48:57","slug":"the-black-hole-prototype-technical-walkthrough","status":"publish","type":"post","link":"https:\/\/dovu.earth\/ja\/the-black-hole-prototype-technical-walkthrough\/","title":{"rendered":"The Black Hole Prototype &#8211; Technical Walkthrough"},"content":{"rendered":"\n<p>In this post, we will learn about the creation of <strong>The Black Hole<\/strong>, a prototype for retiring digital carbon using smart contracts on the Hedera network. The article explores unique challenges and solutions associated with token allowance, association, and transfer. It further highlights the use of <a href=\"https:\/\/www.hashpack.app\/hashconnect\" target=\"_blank\" rel=\"noreferrer noopener\">HashConnect<\/a> and <a href=\"https:\/\/hips.hedera.com\/hip\/hip-584\" target=\"_blank\" rel=\"noreferrer noopener\">HIP-584<\/a> to create a user-friendly web app for interacting with The Black Hole. The post also briefly delves into future improvements and ambitions, such as reducing gas costs, solving the rent payment dilemma, and the potential for carbon retirement in the crypto-space.<\/p>\n\n\n\n<p>This technical breakdown complements the <a href=\"https:\/\/dovu.earth\/carbon-retirement-the-black-hole-prototype\" target=\"_blank\" rel=\"noreferrer noopener\">DOVU announcement of The Black Hole protocol<\/a>. Please read that first for context then head back here to get a deep dive into the technical details.<\/p>\n\n\n\n<p>If you&#8217;d like to jump straight to the demo then please head over to <a href=\"https:\/\/blackhole.staging.dovu.earth\/\" target=\"_blank\" rel=\"noreferrer noopener\">The Black Hole Prototype Demo<\/a> which is a NextJS site demoing the interaction with The Black Hole smart contract.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why?<\/h2>\n\n\n\n<p>Because who wouldn&#8217;t want to put &#8220;Built a Black Hole&#8221; on their r\u00e9sum\u00e9!?<\/p>\n\n\n\n<p>\u2026also, The Black Hole is a prototype for the <a href=\"https:\/\/dovu.earth\/en\/bridging-esg-and-defi-how-dovu-will-unlock-the-next-generation-of-carbon-retirement\/\" target=\"_blank\" rel=\"noreferrer noopener\">DOVU retirement protocol<\/a>. In building this prototype, we have been able to explore and improve <a href=\"https:\/\/github.com\/dovuofficial\/hedera-hardhat-tooling\" target=\"_blank\" rel=\"noreferrer noopener\">our tools<\/a> for the creation and deployment of smart contracts on Hedera. It is also very important to us that everyone is able to easily interact with it, so we built <a href=\"https:\/\/blackhole.staging.dovu.earth\/\" target=\"_blank\" rel=\"noreferrer noopener\">a frontend app<\/a> using NextJS to demo The Black Hole prototype. We make use of the <a href=\"https:\/\/testnet.mirrornode.hedera.com\/api\/v1\/docs\/#\/contracts\/contractsCall\" target=\"_blank\" rel=\"noreferrer noopener\">new mirror node endpoint<\/a><code> POST \/api\/v1\/contracts\/call<\/code> that <a href=\"https:\/\/hips.hedera.com\/hip\/hip-584\" target=\"_blank\" rel=\"noreferrer noopener\">HIP-584<\/a> enables, allowing us to read our contract state for free. The demo also makes use of <a href=\"https:\/\/www.hashpack.app\/hashconnect\" target=\"_blank\" rel=\"noreferrer noopener\">HashConnect<\/a> for signing transactions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Securing a One Way Black Hole<\/h2>\n\n\n\n<p>The Black Hole smart contract is designed to consume NFTs. It enables the transfer of NFTs to itself but purposely provides no ability to transfer them out other than from network side effects such as not paying rent which we discuss later. In addition to this, The Black Hole also keeps track of a couple of basic stats:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The total number of NFTs it has consumed<\/li>\n\n\n\n<li>A list of accounts and the NFTs each account has sent to be consumed<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Steps Into the Abyss with Consent<\/h2>\n\n\n\n<p>There are three steps to transferring an NFT into The Black Hole:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The Allowance Approval (Required before calling the smart contract)<\/li>\n\n\n\n<li>The Token Association (Smart contract function)<\/li>\n\n\n\n<li>The Token Transfer (Smart contract function)<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">The Allowance Approval<\/h3>\n\n\n\n<p>The recent <a href=\"https:\/\/hedera.com\/blog\/get-ready-for-the-updated-security-model-of-the-hedera-smart-contract-service-by-july-2023\" target=\"_blank\" rel=\"noreferrer noopener\">security updates<\/a> to Hedera requires an additional layer of permission granting from the owner before a smart contract can interact with their tokens. If you want a smart contract to perform any transaction on your tokens, a user must first sign an <a href=\"https:\/\/docs.hedera.com\/hedera\/sdks-and-apis\/sdks\/cryptocurrency\/approve-an-allowance\" target=\"_blank\" rel=\"noreferrer noopener\">AccountAllowanceApproveTransaction<\/a> transaction. This essentially says <em>&#8220;Hey smart contract, I allow you to perform actions on this token as if you were the owner&#8221;<\/em>. Once this step has been completed, the smart contract then has the permissions to act on that token when run.<\/p>\n\n\n\n<p>So, to begin, the user signs an <a href=\"https:\/\/docs.hedera.com\/hedera\/sdks-and-apis\/sdks\/cryptocurrency\/approve-an-allowance\" target=\"_blank\" rel=\"noreferrer noopener\">approveTokenNftAllowance<\/a> transaction which grants the smart contract access to the specific NFT they want to send. The NFT is not transferred at this point, it is still held by the owner and not the smart contract.<\/p>\n\n\n\n<p>Here is a simplified example from our live demo which uses the signer from HashConnect to perform this approval:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import {\n  AccountAllowanceApproveTransaction,\n  AccountId,\n  NftId,\n  Status,\n  TokenId,\n} from &quot;@hashgraph\/sdk&quot;;\n\n\/\/ The token ID\nconst tokenId = TokenId.fromString(&quot;0.0.123456&quot;)\n\n\/\/ The serial we want to transfer\nconst serialNumber = 42 \n\nconst nftId = new NftId(allowanceTokenId, serialNumber)\n\n\/\/ This is the user's account\nconst ownerAccountId = AccountId.fromString(&quot;0.0.234567&quot;)\n\n\/\/ This is The Black Hole smart contract ID\nconst spenderAccountId = AccountId.fromString(&quot;0.0.345678&quot;)\n\nlet transaction = await new AccountAllowanceApproveTransaction()\n  .approveTokenNftAllowance(nftId, ownerAccountId, spenderAccountId)\n  .freezeWithSigner(signer)\n\nconst response = await transaction.executeWithSigner(signer)\n\nconst receipt = await response.getReceiptWithSigner(signer);\n\nif (receipt?.status !== Status.Success) {\n  throw new Error(\n    `Failed to approve allowance for ${tokenId}#${serialNumber}.`\n  );\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">AccountAllowanceApproveTransaction<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">AccountId<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">NftId<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">Status<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">TokenId<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">@hashgraph\/sdk<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ The token ID<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">tokenId<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">TokenId<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">fromString<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0.0.123456<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ The serial we want to transfer<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">serialNumber<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">42<\/span><span style=\"color: #D8DEE9FF\"> <\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">nftId<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">NftId<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">allowanceTokenId<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">serialNumber<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ This is the user&#39;s account<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">ownerAccountId<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">AccountId<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">fromString<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0.0.234567<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ This is The Black Hole smart contract ID<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">spenderAccountId<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">AccountId<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">fromString<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0.0.345678<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">let<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">transaction<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">await<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">AccountAllowanceApproveTransaction<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">approveTokenNftAllowance<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">nftId<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">ownerAccountId<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">spenderAccountId<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">freezeWithSigner<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">signer<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">response<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">await<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">transaction<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">executeWithSigner<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">signer<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">receipt<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">await<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">response<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">getReceiptWithSigner<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">signer<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #D8DEE9\">receipt<\/span><span style=\"color: #ECEFF4\">?.<\/span><span style=\"color: #D8DEE9\">status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">!==<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Status<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">Success<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">throw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">Error<\/span><span style=\"color: #D8DEE9FF\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">`<\/span><span style=\"color: #A3BE8C\">Failed to approve allowance for <\/span><span style=\"color: #81A1C1\">${<\/span><span style=\"color: #D8DEE9\">tokenId<\/span><span style=\"color: #81A1C1\">}<\/span><span style=\"color: #A3BE8C\">#<\/span><span style=\"color: #81A1C1\">${<\/span><span style=\"color: #D8DEE9\">serialNumber<\/span><span style=\"color: #81A1C1\">}<\/span><span style=\"color: #A3BE8C\">.<\/span><span style=\"color: #ECEFF4\">`<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  )<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>It is important to remember that the operator ID of the <code>signer<\/code> needs to be the same as the <code>ownerAccountId<\/code> otherwise the transaction will fail.<\/p>\n\n\n\n<p>Once the allowance transaction has been signed by the user, The Black Hole smart contract function <code>castIntoBlackHole<\/code> can be called which carries out the final two steps of token association and transfer.<\/p>\n\n\n\n<p>The <a href=\"https:\/\/github.com\/dovuofficial\/hedera-hardhat-tooling\/blob\/main\/contracts\/BlackHole.sol\" target=\"_blank\" rel=\"noreferrer noopener\">full smart contract<\/a> can be found as an example in our Hedera Hardhat Tooling repo.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"function castIntoBlackHole(address _tokenAddress, int64 _serialNumber) external {\n  _tokenAssociate(_tokenAddress);\n  _tokenTransfer(_tokenAddress, _serialNumber);\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">castIntoBlackHole<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #8FBCBB\">address<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">_tokenAddress<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">int64<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">_serialNumber<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">external<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">_tokenAssociate<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">_tokenAddress<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">_tokenTransfer<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">_tokenAddress<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> _serialNumber<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Token Association<\/h3>\n\n\n\n<p>In order to receive a token, the smart contract must first associate the token ID with its account. We use the <a href=\"https:\/\/github.com\/hashgraph\/hedera-smart-contracts\/tree\/main\/contracts\/hts-precompile\" target=\"_blank\" rel=\"noreferrer noopener\">HederaTokenService.associateToken(\u2026)<\/a> precompiled contract for this.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"function _tokenAssociate(address _tokenAddress) private {\n    int256 response = HederaTokenService.associateToken(address(this), _tokenAddress);\n  if (\n    response != HederaResponseCodes.SUCCESS &amp;&amp;\n    response != HederaResponseCodes.TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT\n  ) {\n    revert(&quot;Associate Failed&quot;);\n  }\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">_tokenAssociate<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #8FBCBB\">address<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">_tokenAddress<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">private<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">int256<\/span><span style=\"color: #D8DEE9FF\"> response <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> HederaTokenService<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">associateToken<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #8FBCBB\">address<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">this<\/span><span style=\"color: #ECEFF4\">),<\/span><span style=\"color: #D8DEE9FF\"> _tokenAddress<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    response <\/span><span style=\"color: #81A1C1\">!=<\/span><span style=\"color: #D8DEE9FF\"> HederaResponseCodes<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">SUCCESS <\/span><span style=\"color: #81A1C1\">&amp;&amp;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    response <\/span><span style=\"color: #81A1C1\">!=<\/span><span style=\"color: #D8DEE9FF\"> HederaResponseCodes<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">revert<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #A3BE8C\">&quot;Associate Failed&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Token Transfer<\/h3>\n\n\n\n<p>Once the token is associated, a call is then made to the pre-compile contract for transferring the NFT from the user&#8217;s account to The Black Hole smart contract account. We take the opportunity to update the analytics properties here too to keep track of the total NFTs sent and updating the NFTs sent by sender address.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"function _tokenTransfer(address _tokenAddress, int64 _serialNumber) private {\n\n  sentNFTs[msg.sender].push(NFT(_tokenAddress, _serialNumber));\n\n  totalNFTs++;\n\n  int256 response = HederaTokenService.transferNFT(_tokenAddress, msg.sender, address(this), _serialNumber);\n\n  if (response != HederaResponseCodes.SUCCESS) {\n    revert(&quot;Transfer Failed&quot;);\n  }\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">_tokenTransfer<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #8FBCBB\">address<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">_tokenAddress<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">int64<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">_serialNumber<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">private<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  sentNFTs<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #81A1C1\">msg.sender<\/span><span style=\"color: #ECEFF4\">].<\/span><span style=\"color: #88C0D0\">push<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #88C0D0\">NFT<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">_tokenAddress<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> _serialNumber<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  totalNFTs<\/span><span style=\"color: #81A1C1\">++;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">int256<\/span><span style=\"color: #D8DEE9FF\"> response <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> HederaTokenService<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">transferNFT<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">_tokenAddress<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">msg.sender<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">address<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">this<\/span><span style=\"color: #ECEFF4\">),<\/span><span style=\"color: #D8DEE9FF\"> _serialNumber<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">response <\/span><span style=\"color: #81A1C1\">!=<\/span><span style=\"color: #D8DEE9FF\"> HederaResponseCodes<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">SUCCESS<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">revert<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #A3BE8C\">&quot;Transfer Failed&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>This completes the transfer and the NFT is now locked away within The Black Hole.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Black Hole State<\/h2>\n\n\n\n<p>Before <a href=\"https:\/\/hips.hedera.com\/hip\/hip-584\" target=\"_blank\" rel=\"noreferrer noopener\">HIP-584<\/a> the only way you could read data from a contract was by directly calling the contract on the mainnet. This costs gas each time you call because you were interacting with the Hashgraph. HIP-584 gave us a really handy <a href=\"https:\/\/testnet.mirrornode.hedera.com\/api\/v1\/docs\/#\/contracts\/contractsCall\" target=\"_blank\" rel=\"noreferrer noopener\">mirror node endpoint<\/a> for performing reads for free! Let&#8217;s take a look at how this is done\u2026<\/p>\n\n\n\n<p>The endpoint is a POST request to <code>api\/v1\/contracts\/call<\/code> . It allows us to call functions on a smart contract. As long as these are view functions that don&#8217;t mutate the contract, then you will get a response as if you were calling it on the mainnet.<\/p>\n\n\n\n<p>The POST takes a payload body similar to this<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"{\n    &quot;data&quot;: &quot;0xcdea2d12&quot;,\n    &quot;from&quot;: &quot;0x00000000000000000000000000000000003636b3&quot;,\n    &quot;to&quot;: &quot;0x000000000000000000000000000000000041797b&quot;\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #8FBCBB\">data<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0xcdea2d12<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #8FBCBB\">from<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0x00000000000000000000000000000000003636b3<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0x000000000000000000000000000000000041797b<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><code>data<\/code> &#8211; This is a hex encoded representation of the function name to call on the contract. We use <a href=\"https:\/\/web3js.org\">Web3<\/a> in our example to do this encoding. The example above encodes the ABI function of getMassOfBlackHole<\/p>\n\n\n\n<p><code>from<\/code> &#8211; This is the senders address as an EVM HEX string<\/p>\n\n\n\n<p><code>to<\/code> &#8211; This is the address of the contract as an EVM HEX string<\/p>\n\n\n\n<p>We use the <a href=\"https:\/\/github.com\/hashgraph\/hedera-sdk-js\" target=\"_blank\" rel=\"noreferrer noopener\">Hedera JS SDK<\/a> to create the EVM solidity addresses for us.<\/p>\n\n\n\n<p>The only other thing we&#8217;ll require is the ABI of the smart contract. This is the JSON file that is generated when you build and deploy your smart contract which describes how to interact with your contract. If you used our <a href=\"https:\/\/github.com\/dovuofficial\/hedera-hardhat-tooling\" target=\"_blank\" rel=\"noreferrer noopener\">Hedera Hardhat Tooling<\/a> then you can find this after you build and deploy your contract in the following folder: <strong><em>\/artificats\/contracts\/&lt;YOUR_CONTRACT&gt;.sol\/&lt;YOUR_CONTRACT&gt;.json<\/em><\/strong>. The ABI in the following example is simply the array from that json file&#8217;s &#8220;abi&#8221; key.<\/p>\n\n\n\n<p>Here is a simplified JavaScript example showing how to construct the payload and make a call to the mirror node on testnet.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import { AccountId } from &quot;@hashgraph\/sdk&quot;;\nimport Web3 from &quot;web3&quot;;\n\nconst web3 = new Web3();\n\nconst abi = [\n  {\n    inputs: [],\n    name: &quot;getMassOfBlackHole&quot;,\n    outputs: [\n      {\n        internalType: &quot;int64&quot;,\n        name: &quot;&quot;,\n        type: &quot;int64&quot;,\n      },\n    ],\n    stateMutability: &quot;view&quot;,\n    type: &quot;function&quot;,\n  },\n  {...},\n]\n\n\/\/ The function name in the contract we want to call\nconst functionName = &quot;getMassOfBlackHole&quot;;\n\n\/\/ The Hedera account ID of the user calling the contract\nconst fromAddress = &quot;0.0.3552947&quot;\n\n\/\/ The Hedera contract ID of the contract\nconst contractAddress = &quot;0.0.4290939&quot;\n\n\/\/ Fetch the function entity from the ABI\nconst matchedAbiFunction = abi.find(\n  (f) =&gt; f.name === functionName\n);\n\n\/\/ Encode the function call\nconst encodedFunctionCall = web3.eth.abi.encodeFunctionCall(matchedAbiFunction,[]);\n\n\/\/ Convert the Hedera account ID and contract ID to EVM addresses\nconst contractEvmAddress = AccountId.fromString(contractAddress).toSolidityAddress();\nconst fromEvmAddress = AccountId.fromString(fromAddress).toSolidityAddress();\n\n\/\/ Add the 0x prefix to the EVM addresses to make them valid HEX strings\nconst contractEvmAddressHex = &quot;0x&quot;.concat(contractEvmAddress);\nconst fromEvmAddressHex = &quot;0x&quot;.concat(fromEvmAddress);\n\n\/\/ The body of the request to the API\nconst payload = {\n  data: encodedFunctionCall, \/\/ &quot;0xcdea2d12&quot;\n  from: fromEvmAddressHex, \/\/ &quot;0x00000000000000000000000000000000003636b3&quot;\n  to: contractEvmAddressHex, \/\/ &quot;0x000000000000000000000000000000000041797b&quot;\n};\n\n\/\/ Make a POST request to the mirror node with the payload\nconst response = await fetch('https:\/\/testnet.mirrornode.hedera.com\/api\/v1\/contracts\/call', {\n  method: 'POST',\n  headers: {\n      'Content-Type': 'application\/json',\n  },\n  body: JSON.stringify(payload),\n});\nconst data = await response.json();\n\n\/* Example data response\n{\n    &quot;result&quot;: &quot;0x0000000000000000000000000000000000000000000000000000000000000019&quot;\n}\n*\/\n\nconst hex = data.result;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">AccountId<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">@hashgraph\/sdk<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">Web3<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">web3<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">web3<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">Web3<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">abi<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">inputs<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> []<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">name<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">getMassOfBlackHole<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">outputs<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">      <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">internalType<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">int64<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">name<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">type<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">int64<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">      <\/span><span style=\"color: #ECEFF4\">},<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    ]<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">stateMutability<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">view<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">type<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">function<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">},<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">{<\/span><span style=\"color: #81A1C1\">...<\/span><span style=\"color: #ECEFF4\">},<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ The function name in the contract we want to call<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">functionName<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">getMassOfBlackHole<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ The Hedera account ID of the user calling the contract<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">fromAddress<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0.0.3552947<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ The Hedera contract ID of the contract<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">contractAddress<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0.0.4290939<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ Fetch the function entity from the ABI<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">matchedAbiFunction<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">abi<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">find<\/span><span style=\"color: #D8DEE9FF\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9\">f<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">f<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">name<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">===<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">functionName<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ Encode the function call<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">encodedFunctionCall<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">web3<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">eth<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">abi<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">encodeFunctionCall<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">matchedAbiFunction<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\">[])<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ Convert the Hedera account ID and contract ID to EVM addresses<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">contractEvmAddress<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">AccountId<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">fromString<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">contractAddress<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">toSolidityAddress<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">fromEvmAddress<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">AccountId<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">fromString<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">fromAddress<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">toSolidityAddress<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ Add the 0x prefix to the EVM addresses to make them valid HEX strings<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">contractEvmAddressHex<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0x<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">concat<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">contractEvmAddress<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">fromEvmAddressHex<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0x<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">concat<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">fromEvmAddress<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ The body of the request to the API<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">payload<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">data<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">encodedFunctionCall<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\">\/\/ &quot;0xcdea2d12&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">from<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">fromEvmAddressHex<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\">\/\/ &quot;0x00000000000000000000000000000000003636b3&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">to<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">contractEvmAddressHex<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\">\/\/ &quot;0x000000000000000000000000000000000041797b&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ Make a POST request to the mirror node with the payload<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">response<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">await<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">fetch<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">https:\/\/testnet.mirrornode.hedera.com\/api\/v1\/contracts\/call<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">method<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">POST<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">headers<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">      <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Content-Type<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">application\/json<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">},<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">body<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">JSON<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">stringify<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">payload<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">data<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">await<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">response<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">json<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/* Example data response<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">    &quot;result&quot;: &quot;0x0000000000000000000000000000000000000000000000000000000000000019&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">*\/<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">hex<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">data<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">result<\/span><span style=\"color: #81A1C1\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Once we have the hex response data back, we can use Web3 to decode it for us so it&#8217;s easier to use:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import Web3 from &quot;web3&quot;;\n\nconst web3 = new Web3();\n\nconst abi = [\n  {\n    inputs: [],\n    name: &quot;getMassOfBlackHole&quot;,\n    outputs: [\n      {\n        internalType: &quot;int64&quot;,\n        name: &quot;&quot;,\n        type: &quot;int64&quot;,\n      },\n    ],\n    stateMutability: &quot;view&quot;,\n    type: &quot;function&quot;,\n  }\n]\n\n\/**\n* Decodes the result of a contract's function execution\n* @param functionName the name of the function within the ABI\n* @param hex a hex string containing the execution result\n*\/\nexport function decodeFunctionResult ({functionName, hex}) {\n \n  const functionAbi = abi.find((func) =&gt; func.name === functionName);\n  if (!functionAbi) {\n    throw new Error(`Function &quot;${functionName}&quot; not found in ABI`);\n  }\n \n  const functionParameters = functionAbi.outputs;\n\n  if (!functionParameters) {\n    throw new Error(`Function &quot;${functionName}&quot; has no output parameters`);\n  }\n\n  const result = web3.eth.abi.decodeParameters(functionParameters, hex);\n\n  \/*\n    `result` will look like this:\n\n    { '0': '25', __length__: 1 }\n   \n    In this situation we only have a single output but if you have more\n    outputs from your contract function, then you'll need to handle\n    them here.\n  *\/\n\n  return result[0];\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">Web3<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">web3<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">web3<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">Web3<\/span><span style=\"color: #D8DEE9FF\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">abi<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">inputs<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> []<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">name<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">getMassOfBlackHole<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">outputs<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">      <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">internalType<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">int64<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">name<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">type<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">int64<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">      <\/span><span style=\"color: #ECEFF4\">},<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    ]<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">stateMutability<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">view<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">type<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">function<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">* Decodes the result of a contract&#39;s function execution<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">* <\/span><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #8FBCBB\">param<\/span><span style=\"color: #616E88\"> <\/span><span style=\"color: #D8DEE9\">functionName<\/span><span style=\"color: #616E88\"> the name of the function within the ABI<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">* <\/span><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #8FBCBB\">param<\/span><span style=\"color: #616E88\"> <\/span><span style=\"color: #D8DEE9\">hex<\/span><span style=\"color: #616E88\"> a hex string containing the execution result<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">*\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">export<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">decodeFunctionResult<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">({<\/span><span style=\"color: #D8DEE9\">functionName<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">hex<\/span><span style=\"color: #ECEFF4\">})<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">functionAbi<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">abi<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">find<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9\">func<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">func<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">name<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">===<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">functionName<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #D8DEE9\">functionAbi<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">throw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">Error<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">`<\/span><span style=\"color: #A3BE8C\">Function &quot;<\/span><span style=\"color: #81A1C1\">${<\/span><span style=\"color: #D8DEE9\">functionName<\/span><span style=\"color: #81A1C1\">}<\/span><span style=\"color: #A3BE8C\">&quot; not found in ABI<\/span><span style=\"color: #ECEFF4\">`<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">functionParameters<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">functionAbi<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">outputs<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #D8DEE9\">functionParameters<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">throw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">Error<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">`<\/span><span style=\"color: #A3BE8C\">Function &quot;<\/span><span style=\"color: #81A1C1\">${<\/span><span style=\"color: #D8DEE9\">functionName<\/span><span style=\"color: #81A1C1\">}<\/span><span style=\"color: #A3BE8C\">&quot; has no output parameters<\/span><span style=\"color: #ECEFF4\">`<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">result<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">web3<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">eth<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">abi<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">decodeParameters<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">functionParameters<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">hex<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #616E88\">\/*<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">    `result` will look like this:<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">    { &#39;0&#39;: &#39;25&#39;, __length__: 1 }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">   <\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">    In this situation we only have a single output but if you have more<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">    outputs from your contract function, then you&#39;ll need to handle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">    them here.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">  *\/<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">result<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">]<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>You can now call the decoder with the hex value you retrieved from the mirror node<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"const result = decodeFunctionResult({functionName, hex})\n\n\/\/ result: 25\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">result<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">decodeFunctionResult<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">{<\/span><span style=\"color: #D8DEE9\">functionName<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">hex<\/span><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ result: 25<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>We now have the decoded value from the contract and this was free to call!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">From Black Holes to Carbon Retirement<\/h2>\n\n\n\n<p>With The Black Hole built, we&#8217;re now able to reflect and look at the next steps to a carbon retirement protocol.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Saving Fuel<\/h3>\n\n\n\n<p>We can reduce gas costs by first checking if The Black Hole has the token ID associated and skip the associate token call.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Fallback Fees<\/h3>\n\n\n\n<p>When transferring an NFT that has fallback fees, the receiver of the NFT would normally have to pay for this. Our demo doesn&#8217;t currently support these kind of NFTs but could be adjusted to do so. We don&#8217;t expect carbon credit NFTs to have fallback fees set but we can cater for this if need be.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">DOV to Solve The Black Hole Rent Dilemma<\/h3>\n\n\n\n<p>Every smart contract on Hedera has to pay rent to the network to avoid being deleted. Although this fee is minimal it still needs to be considered carefully when dealing with a protocol which is meant to guarantee it&#8217;ll be around forever keeping those NFTs locked away. In our <a href=\"https:\/\/dovu.earth\/en\/bridging-esg-and-defi-how-dovu-will-unlock-the-next-generation-of-carbon-retirement\/\" target=\"_blank\" rel=\"noreferrer noopener\">retirement announcement blog post<\/a>, we hinted at the concept of a <em><strong>smart contract that would use DOV as a form of gas<\/strong><\/em> for the execution of the contract. The DOV would be swapped for HBAR via a DEX contract, such as <a href=\"https:\/\/www.saucerswap.finance\/\" target=\"_blank\" rel=\"noreferrer noopener\">Saucerswap<\/a>, ensuring that the contract was able to exist without having to rely on the manual injection of HBAR for rent payments.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">A Cluster of Auto Spawning Black Holes<\/h3>\n\n\n\n<p>Scaling the smart contract to support storing millions of NFTs may require a cluster of black holes, as Hedera accounts have historically been limited to holding a finite amount of value. As a contract reaches a certain threshold there may be a need to spawn a new version of itself. Using <em><strong>DOV as gas <\/strong><\/em>will become critical in this respect to maintain the existence, auto creation and maintenance of these contracts on the network, in permanence. <\/p>\n\n\n\n<p>These challenges will turn into interesting opportunities to gamify the protocol for the DOVU community.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Analytics<\/h3>\n\n\n\n<p>Providing a simple and transparent view into the state of The Black Hole is crucial for those that need to report on it. There is scope for adding events and tracking other key indicators to make reporting and reacting to the state of the contract easy. We aim to make carbon retirement as simple and transparent as possible.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u2026and breathe<\/h2>\n\n\n\n<p>If you&#8217;re still with us here then thank you! It&#8217;s been a deep dive and we hope you&#8217;ve gleaned some knowledge from it. We&#8217;re sure you&#8217;ll have questions and we&#8217;d love to get the community&#8217;s feedback on this too as together we can create amazing things!<\/p>\n\n\n\n<p>This is just the beginning &#8211; from the depths of The Black Hole, we are ready to take on the greater challenge of carbon retirement. We&#8217;re excited about the potential impact and the role we can play in driving forward sustainable practices in the crypto-space. Stay tuned for future developments as we continue to enhance our carbon retirement protocol.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network. The article explores unique challenges and solutions associated with token allowance, association, and transfer. It further highlights the use of HashConnect and HIP-584 to&#8230;<\/p>\n<div class=\"mt-4\"><a class=\"read-more ajax-blogpost\" href=\"https:\/\/dovu.earth\/ja\/the-black-hole-prototype-technical-walkthrough\/\" data-id=\"1684\">Read More<\/a><\/div>","protected":false},"author":2,"featured_media":1685,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news-insight"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Black Hole Prototype - Technical Walkthrough - DOVU<\/title>\n<meta name=\"description\" content=\"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dovu.earth\/ja\/the-black-hole-prototype-technical-walkthrough\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Black Hole Prototype - Technical Walkthrough - DOVU\" \/>\n<meta property=\"og:description\" content=\"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dovu.earth\/ja\/the-black-hole-prototype-technical-walkthrough\/\" \/>\n<meta property=\"og:site_name\" content=\"DOVU\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DOVU.Earth\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-20T11:47:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-16T13:48:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dovu.earth\/wp-content\/uploads\/2023\/05\/The-Black-Hole-Technical-Social.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dovu Admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.\" \/>\n<meta name=\"twitter:creator\" content=\"@dovuofficial\" \/>\n<meta name=\"twitter:site\" content=\"@dovuofficial\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dovu Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"11\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/\"},\"author\":{\"name\":\"Dovu Admin\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/#\\\/schema\\\/person\\\/ab9d15c5797c1090f9d0a8e570daf4c2\"},\"headline\":\"The Black Hole Prototype &#8211; Technical Walkthrough\",\"datePublished\":\"2023-06-20T11:47:23+00:00\",\"dateModified\":\"2024-12-16T13:48:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/\"},\"wordCount\":1569,\"publisher\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/dovu.earth\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/The-Black-Hole-Technical-Social.jpg\",\"articleSection\":[\"BLOG POSTS\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/\",\"url\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/\",\"name\":\"The Black Hole Prototype - Technical Walkthrough - DOVU\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/dovu.earth\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/The-Black-Hole-Technical-Social.jpg\",\"datePublished\":\"2023-06-20T11:47:23+00:00\",\"dateModified\":\"2024-12-16T13:48:57+00:00\",\"description\":\"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/#primaryimage\",\"url\":\"https:\\\/\\\/dovu.earth\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/The-Black-Hole-Technical-Social.jpg\",\"contentUrl\":\"https:\\\/\\\/dovu.earth\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/The-Black-Hole-Technical-Social.jpg\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/the-black-hole-prototype-technical-walkthrough\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dovu.earth\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Black Hole Prototype &#8211; Technical Walkthrough\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/#website\",\"url\":\"https:\\\/\\\/dovu.earth\\\/\",\"name\":\"DOVU\",\"description\":\"Home\",\"publisher\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dovu.earth\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/#organization\",\"name\":\"DOVU\",\"url\":\"https:\\\/\\\/dovu.earth\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/dovu.earth\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/Dovu-Logo-Icon.svg\",\"contentUrl\":\"https:\\\/\\\/dovu.earth\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/Dovu-Logo-Icon.svg\",\"width\":97,\"height\":97,\"caption\":\"DOVU\"},\"image\":{\"@id\":\"https:\\\/\\\/dovu.earth\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/DOVU.Earth\\\/\",\"https:\\\/\\\/x.com\\\/dovuofficial\",\"https:\\\/\\\/www.instagram.com\\\/dovuofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/11116224\\\/admin\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCxiQtFv5gIaxIr1hnF1PQOw\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/dovu.earth\\\/#\\\/schema\\\/person\\\/ab9d15c5797c1090f9d0a8e570daf4c2\",\"name\":\"Dovu Admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Black Hole Prototype - Technical Walkthrough - DOVU","description":"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.","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:\/\/dovu.earth\/ja\/the-black-hole-prototype-technical-walkthrough\/","og_locale":"ja_JP","og_type":"article","og_title":"The Black Hole Prototype - Technical Walkthrough - DOVU","og_description":"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.","og_url":"https:\/\/dovu.earth\/ja\/the-black-hole-prototype-technical-walkthrough\/","og_site_name":"DOVU","article_publisher":"https:\/\/www.facebook.com\/DOVU.Earth\/","article_published_time":"2023-06-20T11:47:23+00:00","article_modified_time":"2024-12-16T13:48:57+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/dovu.earth\/wp-content\/uploads\/2023\/05\/The-Black-Hole-Technical-Social.jpg","type":"image\/jpeg"}],"author":"Dovu Admin","twitter_card":"summary_large_image","twitter_description":"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.","twitter_creator":"@dovuofficial","twitter_site":"@dovuofficial","twitter_misc":{"\u57f7\u7b46\u8005":"Dovu Admin","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"11\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/#article","isPartOf":{"@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/"},"author":{"name":"Dovu Admin","@id":"https:\/\/dovu.earth\/#\/schema\/person\/ab9d15c5797c1090f9d0a8e570daf4c2"},"headline":"The Black Hole Prototype &#8211; Technical Walkthrough","datePublished":"2023-06-20T11:47:23+00:00","dateModified":"2024-12-16T13:48:57+00:00","mainEntityOfPage":{"@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/"},"wordCount":1569,"publisher":{"@id":"https:\/\/dovu.earth\/#organization"},"image":{"@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/#primaryimage"},"thumbnailUrl":"https:\/\/dovu.earth\/wp-content\/uploads\/2023\/05\/The-Black-Hole-Technical-Social.jpg","articleSection":["BLOG POSTS"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/","url":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/","name":"The Black Hole Prototype - Technical Walkthrough - DOVU","isPartOf":{"@id":"https:\/\/dovu.earth\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/#primaryimage"},"image":{"@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/#primaryimage"},"thumbnailUrl":"https:\/\/dovu.earth\/wp-content\/uploads\/2023\/05\/The-Black-Hole-Technical-Social.jpg","datePublished":"2023-06-20T11:47:23+00:00","dateModified":"2024-12-16T13:48:57+00:00","description":"we will learn about the creation of The Black Hole, a prototype for retiring digital carbon using smart contracts on the Hedera network.","breadcrumb":{"@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/#primaryimage","url":"https:\/\/dovu.earth\/wp-content\/uploads\/2023\/05\/The-Black-Hole-Technical-Social.jpg","contentUrl":"https:\/\/dovu.earth\/wp-content\/uploads\/2023\/05\/The-Black-Hole-Technical-Social.jpg","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/dovu.earth\/the-black-hole-prototype-technical-walkthrough\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dovu.earth\/"},{"@type":"ListItem","position":2,"name":"The Black Hole Prototype &#8211; Technical Walkthrough"}]},{"@type":"WebSite","@id":"https:\/\/dovu.earth\/#website","url":"https:\/\/dovu.earth\/","name":"DOVU","description":"Home","publisher":{"@id":"https:\/\/dovu.earth\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dovu.earth\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/dovu.earth\/#organization","name":"DOVU","url":"https:\/\/dovu.earth\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/dovu.earth\/#\/schema\/logo\/image\/","url":"https:\/\/dovu.earth\/wp-content\/uploads\/2021\/06\/Dovu-Logo-Icon.svg","contentUrl":"https:\/\/dovu.earth\/wp-content\/uploads\/2021\/06\/Dovu-Logo-Icon.svg","width":97,"height":97,"caption":"DOVU"},"image":{"@id":"https:\/\/dovu.earth\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DOVU.Earth\/","https:\/\/x.com\/dovuofficial","https:\/\/www.instagram.com\/dovuofficial\/","https:\/\/www.linkedin.com\/company\/11116224\/admin\/","https:\/\/www.youtube.com\/channel\/UCxiQtFv5gIaxIr1hnF1PQOw"]},{"@type":"Person","@id":"https:\/\/dovu.earth\/#\/schema\/person\/ab9d15c5797c1090f9d0a8e570daf4c2","name":"Dovu Admin"}]}},"_links":{"self":[{"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/posts\/1684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/comments?post=1684"}],"version-history":[{"count":0,"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/posts\/1684\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/media\/1685"}],"wp:attachment":[{"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/media?parent=1684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/categories?post=1684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dovu.earth\/ja\/wp-json\/wp\/v2\/tags?post=1684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}