Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Introduction A Collaborative Research and Development Platform

Platform Logic

Matryx consists of 3 major contracts: MatryxSystem, MatryxPlatform, and MatryxForwarder.


  • Contains all released versions of the Platform
  • Contains all used libraries addresses
  • Contains all relevant data needed to transform function signatures for forwarding calls


  • Contains all data for Tournaments, Commits, and Submissions
  • Forwards calls from MatryxForwarder contracts to the relevant libraries


  • Forwards calls to MatryxPlatform

When a call is made on a MatryxForwarder contract, such as MatryxTournament, MatryxForwarder forwards the call to MatryxPlatform, inserting msg.sender into the calldata so the original caller doesn't get lost. MatryxPlatform then looks up information from MatryxSystem to get the current library for that function and version of the Platform. It then uses this information to transform the calldata again, inserting state data from the Platform so that the library has access to Tournament, Commit, and Submission data.

For every library method in Matryx, MatryxSystem stores the function signature transformation data used to modify calldata. The calldata is modified by inserting MatryxPlatform storage slots for the delegatecall to the library method. This enables the libraries to modify MatryxPlatform's state while keeping the outwardly facing contract method signatures simple.

An example of this logic:

=> call to MatryxTournament.getBalance
=> call to MatryxSystem to lookup Platform address
=> call to MatryxPlatform (inserting msg.sender address)
=> call to MatryxSystem to lookup forwarding info
=> delegatecall to LibTournament.getBalance (inserting Platform storage data)

An example of a MTX transfer between MatryxForwarder contracts:

=> call to MatryxTournament.transferTo
=> delegatecall to LibForwarder.transferTo
=> call to MatryxToken.transfer

We set up the Matryx system like this to enable upgradeability, as well as to minimize gas costs of creating Tournaments, Commits, and Submissions.

Testing Matryx locally with truffle console

  1. Install dependencies, remove the build folder, and start ganache

    npm i
    rm -r build/
  2. Then in a new window, enter the truffle console

    truffle console
  3. Execute the following commands inside truffle console

    migrate --reset
    .load setup
  4. Lastly, you can test out the platform by running

    exec truffle/test.js

Architecture Diagram

architecture diagram

-The Matryx Team