1

Clone Repository

README.md
git clone https://github.com/bunsdev/cct-linklabs.git
2

Install Foundry

README.md
curl -L https://foundry.paradigm.xyz | bash
3

Install Dependencies

README.md
yarn && make
4

Setup Environment

Run the command below, then update the .env PRIVATE_KEY and ETHERSCAN_API_KEY RPC_URL variables.

README.md
if [ -f .env ]; then
    echo "We will use the .env your have already created."
    else
    if [ -z "${DOTENV}" ]; then
        echo "Creating and setting .env"
        cp .env.example .env && source .env
        echo "Set your PRIVATE_KEY and ETHERSCAN_API_KEY and RPC_URL in .env"
    fi
fi
5

Create Wallet

To create a new wallet that is stored in a keystore, issue the following command, which will prompt you to secure the private key with a password.

README.md
# Grabs the PRIVATE_KEY from the .env file.
PRIVATE_KEY=$(grep PRIVATE_KEY .env | cut -d '=' -f2)

if [ -f keystore/secret ]; then
    echo "Found keystore in workspace"
    else
    if [ -z "${DOTENV}" ]; then
        echo "Creating and setting keystore"
        mkdir keystore
        cast wallet import --private-key $PRIVATE_KEY -k keystore secret
        echo "keystore/secret created"
    fi
fi

For ease use of the keystore we already configured a environment variable called KEYSTORE pointing to the keystore file in the working directory.

You can use the wallet stored in the keystore by adding the --keystore flag instead of the --private-key flag. Run the command below to confirm your wallet address is stored accurately.

README.md
KEYSTORE=$(grep KEYSTORE .env | cut -d '=' -f2)
cast wallet address --keystore $KEYSTORE
export WALLET_ADDRESS=$(cast wallet address --keystore $KEYSTORE)