VyperTraining Smart Contracts

1 - Setting up the environment:

Recommendations:

The following tools are not required but highly recommended for a better coding experience:



Requirements:

  • Git of course :-)

  • pyenv-virtualenv :

    • Mac OS:

      1. Install Homebrew (install)

      2. Install package:

        brew install pyenv-virtualenv
      3. Add it to path (assuming you are using ZSH)

        echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
        echo 'eval "$(pyenv init -)"' >> ~/.zshrc
        echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
    • Other OS: (Follow instructions to install)



Configuration Steps:

  1. Clone the repo

    git clone git@github.com:VyperTraining/smart-contracts.git

    and then:

    cd smart-contracts
  2. Install python version

    pyenv install 3.9.8
  3. Create the Python virtual environment (Only needed once)

    pyenv virtualenv 3.9.8 vyper-training
    
  4. Update PIP

    pip install -U pip
  5. Install Vyper

    pip install vyper==0.3.3
  6. Install Black (Code formatter)

    pip install black
  7. Install Ape Worx

    pip install eth-ape
  8. Install Vyper Plugin

    ape plugins install vyper


Running the project:

  • To Compile the smart-contracts, run:
    ape compile
  • Run tests with:
    ape test