Skip to content

santiellena/switchlane-sc

Repository files navigation

Switchlane

Quickstart

Requirements:

First of all, install Make:

{% embed url="https://www.geeksforgeeks.org/how-to-install-make-on-ubuntu/" %}

To use this code, you need to have installed foundry & npm.

To check if you have them installed:

# In case you have them installed you will see the versions
$ forge --version
$ npm --version

The Makefile has the install command to download and install everything you need to start testing and developing.

$ make install

Before starting the development or testing you need to set up your environment variables:

  1. Create your .env file
  2. Put your own private key (not needed for testing)
  3. Go to Chiannodes or to Alchemy to get your RPC URLs to connect and get the fork data.

As Switchlane depends directly on other smart contracts most of its functions (if not all of them) need interactions with the blockchain. Additionally, mocking this complex systems is completely impossible, so all tests are fork tests.

Tests:

To run fork tests, located at test/fork/Switchlane.t.sol:

$ make test

To run a specific fork test, located at test/fork/Switchlane.t.sol:

$ make testMatch ARGS="testName"

To run unit tests, located at test/unit/Switchlane.t.sol:

$ make unit

Deploy:

To deploy the Switchlane contract to start interacting with it:

# To deploy on Anvil
$ make deploy

# To deploy on Polygon
$ make deploy ARGS="--network polygon"

# To deploy on Mumbai
$ make deploy ARGS="--network mumbai"

# To deploy on Mainnet
$ make deploy ARGS="--network mainnet"

Releases

No releases published

Packages

No packages published