{"id":7534,"date":"2024-03-29T09:01:32","date_gmt":"2024-03-29T09:01:32","guid":{"rendered":"https:\/\/metaschool.so\/articles\/?p=7534"},"modified":"2024-03-29T09:02:26","modified_gmt":"2024-03-29T09:02:26","slug":"constructor-in-solidity","status":"publish","type":"post","link":"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/","title":{"rendered":"Understanding Constructor in Solidity"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_56_1 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#The_constructor_keyword\" title=\"The constructor keyword\">The constructor keyword<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Constructor_in_Solidity_Optional_but_essential\" title=\"Constructor in Solidity: Optional but essential\">Constructor in Solidity: Optional but essential<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Constructor_in_Solidity_One_and_only\" title=\"Constructor in Solidity: One and only\">Constructor in Solidity: One and only<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Initializing_state_variables\" title=\"Initializing state variables\">Initializing state variables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Constructor_in_Solidity_Function_body_and_syntax\" title=\"Constructor in Solidity: Function body and syntax\">Constructor in Solidity: Function body and syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Taking_it_up_a_notch_Constructors_with_arguments\" title=\"Taking it up a notch: Constructors with arguments\">Taking it up a notch: Constructors with arguments<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Visibility_Matters_Public_internal_or_private\" title=\"Visibility Matters: Public, internal, or private?\">Visibility Matters: Public, internal, or private?<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Public_constructor\" title=\"Public constructor\">Public constructor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Internal_constructor\" title=\"Internal constructor\">Internal constructor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Private_constructor\" title=\"Private constructor:\">Private constructor:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Beyond_the_basics_Advanced_constructor_concepts\" title=\"Beyond the basics: Advanced constructor concepts\">Beyond the basics: Advanced constructor concepts<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Constructor_chaining\" title=\"Constructor chaining\">Constructor chaining<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Payable_constructor_in_Solidity\" title=\"Payable constructor in Solidity\">Payable constructor in Solidity<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/metaschool.so\/articles\/constructor-in-solidity\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>Constructor in Solidity plays a crucial role, similar to how a construction crew sets the foundation for a building. It&#8217;s a special function that gets called automatically only once \u2013 during the creation, or deployment, of your <a href=\"https:\/\/metaschool.so\/articles\/structure-of-a-smart-contract\/\">smart contract<\/a> on the blockchain.<\/p>\n\n\n\n<p>Think of it this way: when you design a blueprint for a house, you specify the number of rooms, their sizes, and maybe even the placement of certain features. A constructor in <a href=\"https:\/\/metaschool.so\/articles\/guide-solidity-contracts\/\">Solidity<\/a> acts like that initial setup phase for your smart contract. It allows you to define the starting state of your contract by initializing its essential variables.<\/p>\n\n\n\n<p>Here&#8217;s a breakdown of the key aspects of the constructor in Solidity:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-constructor-keyword\"><span class=\"ez-toc-section\" id=\"The_constructor_keyword\"><\/span><strong>The <code>constructor<\/code> keyword<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The magic word that brings a constructor function to life is <code>constructor<\/code>. It&#8217;s placed right before the function declaration, indicating its special role in the contract&#8217;s creation process.<\/p>\n\n\n\n<p><strong>\ud83d\udd25 Check this course out:<\/strong>\u00a0<a href=\"https:\/\/metaschool.so\/courses\/one-piece-personality-dapp-solidity\" target=\"_blank\" rel=\"noreferrer noopener\">Build a One Piece Personality dApp With Solidity<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"constructor-in-solidity-optional-but-essential\"><span class=\"ez-toc-section\" id=\"Constructor_in_Solidity_Optional_but_essential\"><\/span>Constructor in Solidity: <strong>Optional but essential<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>While not strictly mandatory, constructors are highly recommended. If you don&#8217;t define one explicitly, Solidity provides a default constructor that simply does nothing. However, for most practical purposes, you&#8217;ll want a custom constructor to ensure your contract starts in a well-defined state.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"constructor-in-solidity-one-and-only\"><span class=\"ez-toc-section\" id=\"Constructor_in_Solidity_One_and_only\"><\/span>Constructor in Solidity: <strong>One and only<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>A contract can only have one constructor. This makes sense because the construction phase happens just once during deployment. So, you can&#8217;t have multiple constructors with different functionalities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"initializing-state-variables\"><span class=\"ez-toc-section\" id=\"Initializing_state_variables\"><\/span><strong>Initializing state variables<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The primary purpose of a constructor is to assign initial values to your contract&#8217;s state variables. These variables hold the data that defines the current state of your smart contract. By initializing them in the constructor, you ensure they have meaningful values from the get-go.<\/p>\n\n\n\n<p>For example, imagine you&#8217;re creating a smart contract for a simple crowdfunding campaign. You might have state variables like <code>targetAmount<\/code> (the goal amount to raise) and <code>balance<\/code> (the current amount collected). The constructor would be the perfect place to set the <code>targetAmount<\/code> and initialize <code>balance<\/code> to zero.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"constructor-in-solidity-function-body-and-syntax\"><span class=\"ez-toc-section\" id=\"Constructor_in_Solidity_Function_body_and_syntax\"><\/span>Constructor in Solidity: <strong>Function body and syntax<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The body of a constructor function looks similar to other functions in Solidity. You can include logic, calculations, and even calls to other functions within the constructor. Here&#8217;s a basic syntax example:<\/p>\n\n\n\n<pre class=\"wp-block-code has-nv-site-bg-background-color has-background\" style=\"font-size:18px\"><code>constructor() public {\n  \/\/ Initialization code for state variables\n  targetAmount = 100 ether;\n  balance = 0;\n}<\/code><\/pre>\n\n\n\n<p>In this example, the constructor is <code>public<\/code> (we&#8217;ll discuss visibility later) and takes no arguments. Inside the curly braces, we have code to assign values to the state variables <code>targetAmount<\/code> and <code>balance<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"taking-it-up-a-notch-constructors-with-arguments\"><span class=\"ez-toc-section\" id=\"Taking_it_up_a_notch_Constructors_with_arguments\"><\/span><strong>Taking it up a notch: Constructors with arguments<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Constructors can also be defined to accept arguments. This allows you to provide custom initial values during deployment. Imagine the crowdfunding example again. What if you want to allow the campaign creator to specify the <code>targetAmount<\/code> during deployment? Here&#8217;s how you can achieve that:<\/p>\n\n\n\n<pre class=\"wp-block-code has-nv-site-bg-background-color has-background\" style=\"font-size:18px\"><code>constructor(uint target) {\n  targetAmount = target;\n  balance = 0;\n}<\/code><\/pre>\n\n\n\n<p>In this case, the constructor takes a single argument of type <code>uint<\/code> (unsigned integer) named <code>target<\/code>. When someone deploys the contract, they can specify the desired <code>targetAmount<\/code> as a value during deployment.<\/p>\n\n\n\n<p><strong>Remember:<\/strong> When using arguments in the constructor, make sure to adjust the initialization code within the function body to use the provided values.<\/p>\n\n\n\n<p><strong>\ud83d\udd25 Check this course out:<\/strong>\u00a0<a href=\"https:\/\/metaschool.so\/courses\/build-marketplace-erc404-tokens\" target=\"_blank\" rel=\"noreferrer noopener\">Build a Semi-Fungible ERC404 Tokens\u2019 Marketplace<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"visibility-matters-public-internal-or-private\"><span class=\"ez-toc-section\" id=\"Visibility_Matters_Public_internal_or_private\"><\/span><strong>Visibility Matters: Public, internal, or private?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Constructors can have different visibility modifiers, just like other functions in Solidity. Let\u2019s see what they are and how they works using coding examples.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"public-constructor\"><span class=\"ez-toc-section\" id=\"Public_constructor\"><\/span><strong>Public constructor<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This is the most widely used type of constructor. It allows anyone to deploy the contract using this specific constructor.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code has-nv-site-bg-background-color has-background\" style=\"font-size:18px\"><code>contract SimpleStore {\n  uint public value;\n\n  constructor() public {\n    value = 10;\n  }\n}<\/code><\/pre>\n\n\n\n<p>In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The contract is named <code>SimpleStore<\/code>.<\/li><li>It has a state variable named <code>value<\/code> of type <code>uint<\/code> (unsigned integer) with <code>public<\/code> visibility.<\/li><li>The constructor is also <code>public<\/code>, allowing anyone to deploy the contract using this constructor.<\/li><li>Inside the constructor, the <code>value<\/code> variable is initialized to 10.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"internal-constructor\"><span class=\"ez-toc-section\" id=\"Internal_constructor\"><\/span><strong>Internal constructor<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>An internal constructor restricts deployment using this constructor to contracts within the same inheritance hierarchy. This is useful for creating base (parent) contracts that can&#8217;t be directly deployed but serve as a foundation for child contracts.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code has-nv-site-bg-background-color has-background\" style=\"font-size:18px\"><code>contract BaseContract {\n  uint internal someData;\n\n  constructor(uint data) internal {\n    someData = data;\n  }\n}\n\ncontract DerivedContract is BaseContract {\n  constructor(uint data) public BaseContract(data) {}\n}<\/code><\/pre>\n\n\n\n<p>Here&#8217;s a breakdown:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The <code>BaseContract<\/code> has an <code>internal<\/code> constructor that takes an argument of type <code>uint<\/code> named <code>data<\/code>.<\/li><li>Since it&#8217;s <code>internal<\/code>, this constructor can only be called by derived contracts within the same inheritance hierarchy.<\/li><li>The <code>DerivedContract<\/code> inherits from <code>BaseContract<\/code>.<\/li><li>Its constructor is <code>public<\/code>, allowing anyone to deploy the derived contract.<\/li><li>It explicitly calls the <code>internal<\/code> constructor of the parent class (<code>BaseContract<\/code>) using <code>super(data)<\/code> and passes the received argument <code>data<\/code>. This ensures proper initialization of the inherited variable <code>someData<\/code>.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"private-constructor\"><span class=\"ez-toc-section\" id=\"Private_constructor\"><\/span><strong>Private constructor:<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A private constructor makes the constructor unusable for deployment from any external contract. It&#8217;s rarely used for constructors but can be helpful in specific scenarios like creating helper contracts that are meant to be used internally by other contracts within the same project.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code has-nv-site-bg-background-color has-background\" style=\"font-size:18px\"><code>contract Factory {\n  \/\/ Helper function to deploy another contract\n  function deployContract() public {\n    new PrivateContract(); \/\/ This can only be called within Factory\n  }\n}\n\ncontract PrivateContract {\n  constructor() private {}\n}<\/code><\/pre>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The <code>Factory<\/code> contract has a public function <code>deployContract<\/code>.<\/li><li>Inside this function, it attempts to deploy a new instance of the <code>PrivateContract<\/code> using <code>new PrivateContract()<\/code>.<\/li><li>However, the constructor of <code>PrivateContract<\/code> is marked as <code>private<\/code>. This means it can only be called from within the <code>Factory<\/code> contract itself, not from any external source during deployment.<\/li><\/ul>\n\n\n\n<p>By using different visibility specifiers for constructors, you can control who can deploy your contract and how. Remember to choose the appropriate visibility based on your specific use case and the desired level of access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"beyond-the-basics-advanced-constructor-concepts\"><span class=\"ez-toc-section\" id=\"Beyond_the_basics_Advanced_constructor_concepts\"><\/span><strong>Beyond the basics: Advanced constructor concepts<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>While the core concepts are covered, there&#8217;s more to explore in the world of Solidity constructors. Let\u2019s understand them in detail using the coding examples.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"constructor-chaining\"><span class=\"ez-toc-section\" id=\"Constructor_chaining\"><\/span><strong>Constructor chaining<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In inheritance scenarios, constructor chaining allows you to call the constructor of the parent contract from the child contract&#8217;s constructor. This ensures that the parent contract&#8217;s initialization logic is executed first, followed by the child contract&#8217;s specific initialization.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code has-nv-site-bg-background-color has-background\" style=\"font-size:18px\"><code>contract Ownable {\n  address public owner;\n\n  constructor() public {\n    owner = msg.sender;\n  }\n}\n\ncontract MyContract is Ownable {\n  uint public value;\n\n  constructor(uint val) public Ownable() {\n    value = val;\n  }\n}<\/code><\/pre>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>We have two contracts: <code>Ownable<\/code> (parent) and <code>MyContract<\/code> (child).<\/li><li><code>Ownable<\/code> has a state variable <code>owner<\/code> to store the address of the contract owner and a public constructor that sets the owner to the message sender (the person deploying the contract).<\/li><li><code>MyContract<\/code> inherits from <code>Ownable<\/code>.<\/li><li>Its constructor takes an argument <code>val<\/code> of type <code>uint<\/code>.<\/li><li>Inside the <code>MyContract<\/code> constructor, we use <code>super()<\/code> to call the constructor of the parent contract (<code>Ownable<\/code>). This ensures that the <code>owner<\/code> variable gets initialized first in the inheritance hierarchy.<\/li><li>Then, the child contract&#8217;s specific initialization happens by assigning the value of <code>val<\/code> to its state variable <code>value<\/code>.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"payable-constructor-in-solidity\"><span class=\"ez-toc-section\" id=\"Payable_constructor_in_Solidity\"><\/span><strong>Payable constructor<\/strong> in Solidity<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>By marking a constructor as <code>payable<\/code>, you allow users to send Ether along with the deployment transaction. This can be useful for scenarios where the contract needs some initial funding upon deployment (e.g., for storage fees on the blockchain).<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code has-nv-site-bg-background-color has-background\" style=\"font-size:18px\"><code>contract DonationPool {\n  address public owner;\n  uint public totalDonations;\n\n  constructor() public payable {\n    owner = msg.sender;\n    totalDonations = msg.value;\n  }\n}<\/code><\/pre>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>This contract represents a donation pool.<\/li><li>It has state variables to track the owner (<code>owner<\/code>) and the total amount of donations received (<code>totalDonations<\/code>).<\/li><li>The constructor is marked as <code>payable<\/code>, allowing users to send Ether during deployment.<\/li><li>Inside the constructor, it sets the <code>owner<\/code> and then assigns the value of <code>msg.value<\/code> (the amount of Ether sent with the deployment transaction) to <code>totalDonations<\/code>. This ensures that the initial donation amount is captured correctly.<\/li><\/ul>\n\n\n\n<p><strong>Important Note:<\/strong><\/p>\n\n\n\n<p>While <code>payable<\/code> constructors allow receiving funds, remember to include proper checks and logic within your contract to handle the received Ether securely and transparently.<\/p>\n\n\n\n<p><strong>\ud83d\udd25 Check this course out:<\/strong>\u00a0<a href=\"https:\/\/metaschool.so\/courses\/build-hogwarts-sorting-cap-dapp-on-polygon-mumbai\" target=\"_blank\" rel=\"noreferrer noopener\">Build Hogwarts Sorting Hat dApp on Polygon<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Constructors in Solidity are fundamental building blocks. By understanding how to use them effectively, you can ensure your smart contracts start in a well-defined state and are ready to function as intended.<\/p>\n\n\n\n<p><strong>Try it out, ask us questions, and tell us how it went by tagging Metaschool on Social Media.<\/strong><\/p>\n\n\n\n<p><strong>Follow us on<\/strong>&nbsp;\u2013<\/p>\n\n\n\n<p>\ud83d\udd2eTwitter \u2013\u00a0<a href=\"https:\/\/twitter.com\/0xmetaschool\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/twitter.com\/0xmetaschool<\/a><\/p>\n\n\n\n<p>\ud83d\udd17LinkedIn \u2013\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/0xmetaschool\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.linkedin.com\/company\/0xmetaschool\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":15,"featured_media":7536,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[292],"tags":[51,31,46,29],"class_list":["post-7534","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-answers","tag-blockchain","tag-ethereum-blockchain","tag-solidity","tag-web3"],"_links":{"self":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/7534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/comments?post=7534"}],"version-history":[{"count":3,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/7534\/revisions"}],"predecessor-version":[{"id":7540,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/7534\/revisions\/7540"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media\/7536"}],"wp:attachment":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media?parent=7534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/categories?post=7534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/tags?post=7534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}