5b6c90daf7 BT-1371 trex factory create3 (#82)
* ✨ integrate foundry alongside hardhat for dual testing framework

- Add foundry.toml configuration
- Reorganize test structure: test/forge/ and test/hardhat/
- Add Foundry scripts to package.json (build:forge, test:forge, coverage:forge)
- Update hardhat.config.ts with evmVersion for compatibility
- Add GitHub workflows and coverage scripts from template
- Add Husky hooks (pre-commit, post-checkout, post-merge)
- Add .vscode/settings.json for better IDE support
- Disable coverage checks until tests are migrated (commented with TODO)

This migration is based on TokenySolutions/contracts-template and enables
gradual migration of tests from Hardhat (TypeScript) to Foundry (Solidity).

Related to: BT-1418

* βœ… trex factory tests

* ⚰️ remove trex suit

* feat(forge): reorganize Foundry test structure and sync GitHub workflows

- Move TREXFactorySetup to helpers folder
- Rename TREXSuite.t.sol to TREXFactory.t.sol
- Update fixture to inherit from Test for proper Foundry pattern
- Transfer ownership to deployer address to match Hardhat behavior
- Sync GitHub workflows with package.json scripts
- Update test.yml to use npm run build and npm run test
- Update push_checking.yml to use unified npm run lint
- Update forge_coverage.sh to use npm run coverage

* fix(ci): install Foundry and skip husky in push_checking workflow

- Add Foundry installation step before npm ci
- Set HUSKY=0 to skip husky setup in CI environment
- Fixes 'forge: not found' error during npm prepare script

* πŸ”§ keep hardhat settings

* βœ… create addressess directly

* βœ… removed test_StandardAddressesSet

* βœ… fix lint

* πŸ’‘ removed title natspecs

* βœ… migrated trex factort tests

* βœ… added test module multicall

* βœ… migrate agent role test

* βœ… migrate claim topics registry

* βœ… migrated trusted issuer registry

* βœ… migrate identity registry storage

* βœ… migrated identity registry tests

* βœ… migrated implementation authority test

* βœ… migrated token agen restrictions

* βœ… migrated token information test

* βœ… migrated token recover

* βœ… migrated token permit

* βœ… migrated token transfer

* βœ… migrated utilities upgrade

* βœ… migrated freeze check

* βœ… migrated compliance check in utilities test

* βœ… migrated eligibility check

* βœ… migrated transfer check in utilities

* βœ… migrated compliance test

* βœ… migrated gateway tests

* πŸ”₯ removed already defined events

* πŸ—‘οΈ imported Initializable error from openzeppelin

* βž• added already defined events and errors

* βœ… added base test token

* βœ… used idFactory

* ♻️ refactored compliance test

* ⚰️ remoced useless vm.prank

* πŸ”§ deleted hardhat configurations

* πŸ’š fixed ci

* refactor: remove 100% coverage requirement from forge_coverage.sh

- Remove strict 100% coverage checks that were causing workflow failures
- Script now only generates and displays coverage report without failing
- Aligns with previous behavior where coverage was informational only

* βœ… resolve getVerifiedDetails

* βœ… applied _getEligibility and remove via-ir from foundry.toml

* βœ… cover tokena and token permit

* βœ… cover compliance

* βœ… cover identity registry

* βœ… increased trex gateway coverage

* βœ… increase coverage for trex factory

* βœ… increased AbstractModuleUpgradeable.sol coverage

* ⚰️ removed abstract module

* πŸ”§ updted generate coverage

* βœ… coverage 100% identity registry

* βœ… coverage 100% trex gate way

* βœ… coverage trex factory

* βœ… coverage 100% AbstractModuleUpgradeable by test module

* βœ… coverage IAFactory.sol

* βœ… coverage 100% for implementation authority

* βœ… coverage 1005 abstract proxy

* βœ… coverage 100% claim topic registry

* βœ… coverage 100% identity registry storage

* βœ… coverage 100% modular compliance proxy

* βœ… coverage trusted issuer registry proxy

* βœ… coverage 100% identity registry

* βœ… coverage 100% token proxy

* 🚨 resolve linter in token information

* βœ… coverage 100% roles

* 🚨 resolve linter

* πŸ”§ added no coverage for test, _testContracts and  utils

* βœ… coverage 100% for token.sol

* βœ… coverage 100% for modular compliance

* βœ… coverage 100% trusted issuer registry

* πŸ”§ restore package.json

* βœ… coverage 100% for utlity checker

* 🚨 fix linter

* πŸ’₯ added create 3 from createx library

* πŸ™ˆ added dependencies folder and out to gitignore

* 🚨 forge fmt linting

* πŸ’₯ duplicated createX

* refactor: organize CreateX files into utils/createx subfolder

* 🚨 fix linting

* πŸ’₯ added suffix contract type salt

* βœ… added createX computeCreate3Address tests

* πŸ’₯ updated saltBytes

* βœ… tested multiple chains

* πŸ’₯ immutable create3 factory variable

* πŸ’₯ updated create3 sources

* πŸ’₯ added fork links

* ⚰️ removed unused code from createx

* πŸ”§ added createx dependency

* πŸ’₯ resolve dependency

* πŸ’₯ added "@" to dependency

* πŸ’₯ added deployment on different chains

* πŸ’₯ added vm.createSelectFork

* πŸ”§ Fix config for CI

* πŸ’š Fix CI workflows

---------

Co-authored-by: Philippe Gonday <[email protected]>
2026-01-16 20:22:25 +08:00
2023-06-05 17:18:51 +02:00
2026-01-16 20:22:25 +08:00
2026-01-16 20:22:25 +08:00
2024-11-20 09:51:37 +01:00
2020-03-02 22:41:37 +01:00

T-REX : Token for Regulated EXchanges

GitHub GitHub release (latest by date) GitHub Workflow Status (branch) GitHub repo size GitHub Release Date




Overview

The T-REX (Token for Regulated EXchanges) protocol is a comprehensive suite of Solidity smart contracts, implementing the ERC-3643 standard and designed to enable the issuance, management, and transfer of security tokens in compliance with regulations. It ensures secure and compliant transactions for all parties involved in the token exchange.

Key Components

The T-REX protocol consists of several key components:

  • ONCHAINID: A smart contract deployed by a user to interact with the security token or any other application where an on-chain identity may be relevant. It stores keys and claims related to a specific identity.

  • Trusted Issuers Registry: This contract houses the addresses of all trusted claim issuers associated with a specific token.

  • Claim Topics Registry: This contract maintains a list of all trusted claim topics related to the security token.

  • Identity Registry: This contract holds the identity contract addresses of all eligible users authorized to hold the token. It is responsible for claim verification.

  • Compliance Smart Contract: This contract independently operates to check whether a transfer is in compliance with the established rules for the token.

  • Security Token Contract: This contract interacts with the Identity Registry to check the eligibility status of investors, enabling token holding and transactions.

Getting Started

  1. Clone the repository: git clone https://github.com/ERC-3643/ERC-3643.git
  2. Install Foundry if you haven't already
  3. Install dependencies: forge soldeer install
  4. Compile the contracts: forge build
  5. Run tests: forge test

Development

This project uses Foundry for development and testing.

Prerequisites

Installation

# Install Foundry dependencies via Soldeer
forge soldeer install

Build Commands

forge build              # Compile contracts

Testing

forge test               # Run tests
forge test --gas-report  # Run tests with gas report

Coverage

Generate coverage reports using the provided script:

bash ./generate_coverage.sh

This will generate:

  • Terminal summary with coverage percentages
  • LCOV report (coverage/lcov.info) for CI/CD integration
  • HTML report (coverage/lcov-report/index.html) for interactive viewing

Note: For HTML reports, lcov must be installed. Install with:

brew install lcov  # macOS

Flatten Contracts

forge flatten <contract-path>  # Flatten a contract

Project Structure

β”œβ”€β”€ contracts/             # Solidity contracts
β”œβ”€β”€ test/                 # Foundry tests (Solidity)
β”œβ”€β”€ foundry.toml          # Foundry configuration
β”œβ”€β”€ soldeer.lock          # Dependency lock file
└── docs/                 # Documentation files

Documentation

For a detailed understanding of the T-REX protocol, please refer to the whitepaper. All functions of T-REX smart contracts are described in the T-REX documentation

Contributing

We welcome contributions from the community. Please refer to the CONTRIBUTING guide for more details.

License

This project is licensed under the GNU General Public License v3.0.



S
Description
Official suite of smart contracts implementing the EIP 3643.
Readme
7.1 MiB
Languages
Solidity 73.2%
TypeScript 25.8%
JavaScript 1%