Code Monkey home page Code Monkey logo

apeworx-bp's Introduction

ApeWorx Boilerplate

Simple boilerplate for smart contract development with ApeWorx.

Installation

Install Dependencies

  • python3 - version 3.7 or greater
  • Node.js, NPM, and Hardhat. See Hardhat's installation documentation for steps.

Note: Make sure hardhat is installed locally in the working directory. Run npx hardhat at the end of the installation and select Create an empty hardhat.config.js.

Setup virtual env:

python3 -m venv venv
source venv/bin/activate

Setup plugins:

ape plugins list -a
ape plugins install solidity vyper hardhat infura alchemy

Setup environment variables (where applicable):

export WEB3_INFURA_PROJECT_ID={YOUR_INFURA_PROJECT_ID}

export WEB3_ALCHEMY_API_KEY={YOUR_ALCHEMY_KEY}

Visit infura or alchemy to get your free key.

Console Usage

To interact with a deployed contract in a local environment, start by opening the console:

ape console --network :mainnet-fork:hardhat

This example used mainnet-fork.

Testing

All tests must be stored under tests/. Each test must start with test_ and end with the .py extension.

ape test

To run a particular test:

ape test test_my_contract

Additionally, you can use -I to open interactive mode and -s to print logs.

ape test test_my_contract -I -s

Deployments

To run a file in scripts/ use:

ape run 1_deploy

Additional info

The ApeWorx folder structure is generally:

project              # The root project directory
├── contracts/       # Project source files, such as '.sol' or '.vy' files
├── tests/           # Project tests, ran using the 'ape test' command
├── scripts/         # Project scripts, such as deploy scripts, ran using the 'ape run <name>' command
└── ape-config.yaml  # The ape project configuration file

apeworx-bp's People

Contributors

albertocevallos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.