* β¨ 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]>
T-REX : Token for Regulated EXchanges
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
- Clone the repository:
git clone https://github.com/ERC-3643/ERC-3643.git - Install Foundry if you haven't already
- Install dependencies:
forge soldeer install - Compile the contracts:
forge build - Run tests:
forge test
Development
This project uses Foundry for development and testing.
Prerequisites
- Foundry - Install from getfoundry.sh
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.