---
title: "Discussion on \"Solidity: Constructors\" | Hashnode"
description: "Discussion on \"Solidity: Constructors\". A constructor is an optional function that is executed upon contract creation.\nHere are examples of how to pass arguments to constructors.\n// SPDX-License-Identifier: MIT\npragma solidity ^0.7.3;\n\n// Base contract X\ncontract X {\n    string public name..."
url: "https://hashnode.com/posts/solidity-constructors/63c052317ea965e31f999b9f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Solidity: Constructors](https://blog.michaeltech.xyz/solidity-constructors?utm_source=hashnode&utm_medium=feed)

A constructor is an optional function that is executed upon contract creation. Here are examples of how to pass arguments to constructors. // SPDX-License-Identifier: MIT pragma solidity ^0.7.3; // Base contract X contract X { string public name...

Jan 12, 2023 · 1 min read · blog.michaeltech.xyz  
Updated Jan 15, 2023  
Read the article

-   [#solidity](https://hashnode.com/tag/solidity)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#web3](https://hashnode.com/tag/web3)
-   [#blockchain](https://hashnode.com/tag/blockchain)

## Written by

[Michael Etokakpan](https://hashnode.com/@micahele)

@micahele

  
[View profile](https://hashnode.com/@micahele)

Software Developer

Full Stack Developer and Cloud Engineer with 4+ years of hands-on experience designing, developing, and implementing applications and solutions using a range of technologies, platforms, and programming languages.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
