Skip to content

PayTroix/Contracts

Repository files navigation

HR_Project_Web3Bridge

This repository contains the smart contracts and related scripts for the HR_Project_Web3Bridge, a blockchain-based solution for managing organizations and contracts. The project leverages Foundry for development, testing, and deployment of Solidity smart contracts.

Deployed Contracts (Lisk Sepolia Network)

Deployed Contracts (Base Sepolia Network)

Table of Contents

Overview

HR_Project_Web3Bridge is a decentralized solution that enables organizations to manage their operations on the blockchain. The project consists of multiple smart contracts that handle organization creation, management, and token operations.

Key Features

  • Organization creation and management
  • Token management system
  • Secure contract interactions
  • Full test coverage
  • Foundry-based development environment

Project Structure

contracts/
├── src/
│   ├── contracts/           # Main contract implementations
│   ├── interfaces/          # Contract interfaces
│   └── libraries/           # Shared libraries and utilities
├── script/                  # Deployment scripts
├── test/                   # Contract test files
└── lib/                    # Dependencies and libraries

Installation

  1. Prerequisites

  2. Clone the Repository

    git clone <repository-url>
    cd HR_Project_Web3Bridge/contracts
  3. Install Dependencies

    forge install

Usage

Compiling Contracts

forge build

Running Tests

forge test

Deploying Contracts

forge script script/deploy.s.sol --rpc-url <your-rpc-url> --private-key <your-private-key> --broadcast

Smart Contracts

OrganizationFactory

  • Main contract for creating and managing organizations
  • Handles organization deployment and registration
  • Maintains organization registry

OrganizationContract

  • Implements organization-specific logic
  • Manages organization members and roles
  • Handles organization-specific operations

Additional Components

  • IERC20.sol: Standard ERC20 interface implementation
  • Tokens.sol: Token management functionality
  • errors.sol: Custom error definitions
  • structs.sol: Shared data structures

Testing

The project includes comprehensive tests for all smart contracts. Test files are located in the test/ directory:

  • OrganizationContract.t.sol
  • OrganizationFactory.t.sol
  • Token.t.sol

To run specific tests:

forge test --match-contract OrganizationFactoryTest

Deployment

The project uses Foundry's deployment system through scripts in the script/ directory. The main deployment script is deploy.s.sol.

Deployment Commands

# Deploy to local network
forge script script/deploy.s.sol --fork-url http://localhost:8545 --broadcast

# Deploy to testnet
forge script script/deploy.s.sol --rpc-url <testnet-rpc> --private-key <pk> --broadcast --verify

Verification Commands

Verification commands can be found in verify_command.txt

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors