> For the complete documentation index, see [llms.txt](https://luntra.gitbook.io/luntra-infrastructure/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luntra.gitbook.io/luntra-infrastructure/smart-contract-deployment-guide-on-hardhat/3.-smart-contract-development.md).

# 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);
    }
}

```
