# 3. Smart Contract Development

### Sample Contract Structure

Your project should have this structure:

```
project-root/
├── contracts/
│   └── Lock.sol (or your contract)
├── scripts/
│   └── deploy.js
├── test/
│   └── Lock.js
├── ignition/
│   └── modules/
│       └── Lock.js
├── hardhat.config.js
└── package.json
```

### Example Smart Contract (contracts/Lock.sol)

```solidity
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;

contract Lock {
    uint public unlockTime;
    address payable public owner;

    event Withdrawal(uint amount, uint when);

    constructor(uint _unlockTime) payable {
        require(
            block.timestamp < _unlockTime,
            "Unlock time should be in the future"
        );

        unlockTime = _unlockTime;
        owner = payable(msg.sender);
    }

    function withdraw() public {
        require(block.timestamp >= unlockTime, "You can't withdraw yet");
        require(msg.sender == owner, "You aren't the owner");

        emit Withdrawal(address(this).balance, block.timestamp);

        owner.transfer(address(this).balance);
    }
}

```


---

# 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://luntra.gitbook.io/luntra-infrastructure/smart-contract-deployment-guide-on-hardhat/3.-smart-contract-development.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.
