Skip to content

Use reusable MDX template to DRY-ify the deployment tables #301

@PaulRBerg

Description

@PaulRBerg

Problem

Page: https://github.com/sablier-labs/docs/blob/1959c2eeb5e4ca71e2ff65ff530b865ed9ec2c60/docs/guides/lockup/02-deployments.mdx

  • Poor developer experience: the rows in the tables no longer fit on a single line
  • There's a lot of repetition
    • Links like core-v1-2-0 are duplicated 148 times
    • The blockchain explorer is duplicated many times, too
  • The first two issues combined makes this page prone to errors (when errors are made)

Solution

Refactor this:

| Contract            | Address                                                                                                               | Deployment                                                                           |
| :------------------ | :-------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------- |
| SablierLockup       | [0x7C01AA3783577E15fD7e272443D44B92d5b21056](https://etherscan.io/address/0x7C01AA3783577E15fD7e272443D44B92d5b21056) | [lockup-v2.0.0](https://github.com/sablier-labs/deployments/blob/main/lockup/v2.0.0) |
| SablierBatchLockup  | [0x3F6E8a8Cffe377c4649aCeB01e6F20c60fAA356c](https://etherscan.io/address/0x3F6E8a8Cffe377c4649aCeB01e6F20c60fAA356c) | [lockup-v2.0.0](https://github.com/sablier-labs/deployments/blob/main/lockup/v2.0.0) |
| LockupNFTDescriptor | [0xA9dC6878C979B5cc1d98a1803F0664ad725A1f56](https://etherscan.io/address/0xA9dC6878C979B5cc1d98a1803F0664ad725A1f56) | [lockup-v2.0.0](https://github.com/sablier-labs/deployments/blob/main/lockup/v2.0.0) |
| Helpers             | [0xf8076E4Fb5cfE8be1C26E61222DC51828Db8C1dc](https://etherscan.io/address/0xf8076E4Fb5cfE8be1C26E61222DC51828Db8C1dc) | [lockup-v2.0.0](https://github.com/sablier-labs/deployments/blob/main/lockup/v2.0.0) |
| VestingMath         | [0x5522CA06Ce080800AB59BA4C091e63f6f54C5E6d](https://etherscan.io/address/0x5522CA06Ce080800AB59BA4C091e63f6f54C5E6d) | [lockup-v2.0.0](https://github.com/sablier-labs/deployments/blob/main/lockup/v2.0.0) |

Into something like this:

import DeploymentTable from "@site/src/snippets/DeploymentTable";

<DeploymentTable product="Lockup" version="v2.0.0" chain="ethereum-mainnet"/>

And the DeploymentTable snippet would render the appropriate Markdown table.

If this doesn't work, we might have to build a React component instead of an MDX snippet.

Planning

This task should be implemented AFTER #300.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions