# Ejercicio 3

En este ejercicio utilizaremos un constructor para inicializar el valor de la variable **`storedInfo` .** Para ello utilizaremos un contador denominado **`countChanges`**&#x71;ue será una variable de tipo uint que debe ser visible de forma pública.

**Pasos a seguir:**

1. Programe el contrato en Remix,
2. Despliéguelo en una red de prueba de Ethereum como Sepolia,
3. Publique y verifique el contrato utilizando un explorador de bloques
4. Interactúe con el contrato a través del explorador de bloques y verifique que el constructor inicializó la variable **`storedInfo`.**

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @title Concepts: Constructor
/// @author Solange Gueiros
contract FirstConstructor {
    string private storedInfo;
    uint public countChanges = 0;

    /**
    * Usamos el constructor para inicializar la variable stored Info
    */
    constructor() {
        storedInfo = "Hello world";
        // Considera el contador esta inicialización?
        // A revisar en clase
    }
    

    function setInfo(string memory myInfo) external {
        storedInfo = myInfo;
        countChanges++;
    }
    
    function getInfo() external view returns (string memory) {
        return storedInfo;
    }  
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://edp.ethkipu.org/modulo-2/fundamentos-de-solidity/constructor/ejercicio-3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
