> For the complete documentation index, see [llms.txt](/llms.txt).

export const contactInfoSource = `// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

contract ContactInfo {
    string public name;
    string public phone;

    // Constructor to initialize name and phone
    constructor(string memory _name, string memory _phone) {
        name = _name;
        phone = _phone;
    }

    // Function to set the name and phone
    function setContactInfo(string memory _name, string memory _phone) public {
        name = _name;
        phone = _phone;
    }

    // Function to get the contact info
    function getContactInfo() public view returns (string memory, string memory) {
        return (name, phone);
    }
}`;


  

:::info[Try this contract in Remix]
Want to deploy and interact with `ContactInfo` without any local setup? Use the button below to open it directly in the Remix IDE. You'll need MetaMask with [Rootstock Testnet configured](/dev-tools/wallets/metamask/) — see the full [Remix + Rootstock guide](/developers/quickstart/remix/) for the exact steps.

{/* Remix deep-link for ContactInfo: https://remix.ethereum.org/?#code=Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4zMDsKCmNvbnRyYWN0IENvbnRhY3RJbmZvIHsKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKICAgIHN0cmluZyBwdWJsaWMgcGhvbmU7CgogICAgLy8gQ29uc3RydWN0b3IgdG8gaW5pdGlhbGl6ZSBuYW1lIGFuZCBwaG9uZQogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfbmFtZSwgc3RyaW5nIG1lbW9yeSBfcGhvbmUpIHsKICAgICAgICBuYW1lID0gX25hbWU7CiAgICAgICAgcGhvbmUgPSBfcGhvbmU7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gc2V0IHRoZSBuYW1lIGFuZCBwaG9uZQogICAgZnVuY3Rpb24gc2V0Q29udGFjdEluZm8oc3RyaW5nIG1lbW9yeSBfbmFtZSwgc3RyaW5nIG1lbW9yeSBfcGhvbmUpIHB1YmxpYyB7CiAgICAgICAgbmFtZSA9IF9uYW1lOwogICAgICAgIHBob25lID0gX3Bob25lOwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGdldCB0aGUgY29udGFjdCBpbmZvCiAgICBmdW5jdGlvbiBnZXRDb250YWN0SW5mbygpIHB1YmxpYyB2aWV3IHJldHVybnMgKHN0cmluZyBtZW1vcnksIHN0cmluZyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gKG5hbWUsIHBob25lKTsKICAgIH0KfQ%3D%3D */}


:::

2. **Compile the Contract**:

Run the following command to compile your smart contract:

```bash
npx hardhat compile
```

You should see a response similar to this:

```bash
Generating typings for: 2 artifacts in dir: typechain-types for target: ethers-v6
Successfully generated 8 typings!
Compiled 2 Solidity files successfully (evm target: paris).
```

This command compiles the project, generating an artifacts folder that contains the compiled data, including the ABI and bytecode for your contract.

```text
├── artifacts
│   ├── build-info
│   │   └── f5da7ce57199502ee2303fea40...
│   └── contracts
│  │   └── ContactInfo.sol
│            ├── ContactInfo.dbg.json
│            └── ContactInfo.json
│
├── cache
├── contracts
│   ├── ContactInfo.sol
│   └── Lock.sol
├── ignition
├── node_modules
├── test
├── typechain-types
├── .gitignore
├── hardhat.config.ts
├── package-lock.json
├── package.json
├── README.md
└── tsconfig.json
```

:::info[Explore the Artifacts Folder]
* Inside the artifacts folder, you’ll find two subfolders:
  * `build-info`
  * `contracts`
    :::
> **Note**: Ensure that the contract’s file name matches the contract’s name in the Solidity code.
- **Locate the ABI and Bytecode**:

  :::info[Info]

  * `ABI`: The Application Binary Interface (ABI) defines the functions, events, and types in the contract, enabling interaction with it.
  * `Bytecode`: The bytecode is the compiled code that will run on the Ethereum Virtual Machine (EVM). This code is deployed to the blockchain.

  :::

  * Open your contract’s folder (`ContactInfo` in this case). You will see two files:
    * `ContactInfo.dbg.json`
    * `ContactInfo.json`


- **Copy the ABI and Bytecode**:
  * Open the `ContactInfo.json` file. Locate and copy the abi and bytecode, which will be used for deployment.

<figure>
<img src="/img/guides/rsk-cli/artifacts-folder.png" alt="Hardhat Artifacts Folder"/>
  <figcaption>Hardhat Artifacts Folder (fig 1.)</figcaption>
</figure>

To proceed, save the ABI and bytecode in a new folder. You can choose any name for the folder, but for this tutorial, we'll use 'file' as an example. Inside this folder:

> * Save the ABI as `abi.json`.
> * Save the bytecode as `bytecode.bin` (make sure to copy the bytecode without quotes).

You will use `.json` for the ABI file because the ABI is structured in JSON format, detailing the functions, events, and types used in the contract. This format is easy for applications to parse and use for interacting with the contract.

For the bytecode, we use `.bin` to indicate it’s a binary file containing the compiled code in hexadecimal format. This file is used directly for deployment, as it represents the actual code that will be executed on the blockchain.

```text
├── files
   ├── abi.json
   └── bytecode.bin
```

  </Step>
  

</Steps>
