0.0.4 • Published 3 years ago

@alpsfinance/core v0.0.4

Weekly downloads
-
License
AGPL-3.0-only
Repository
-
Last release
3 years ago

Alps Smart Contracts 💚

Truffle CI NPM Publish CI npm (scoped) License: AGPL v3

This is the official repository for Alps Finance Smart Contracts using Truffle Framework.

Built with 💚 from Alps Finance Developers.

Table of Contents

🛠️ Pre-requisites

1. Node.js

To install the latest version of Node.js, click here and follow the steps.

2. NPM/Yarn

If you plan to use NPM as your package manager, then you can skip this step because NPM comes with Node.js. Otherwise, if you would like to use yarn, then run the following command to install yarn:

npm i -g yarn

3. Truffle

To install truffle, run the following command:

// NPM
npm i -g truffle

// Yarn
yarn global add truffle

4. Moralis Admin Account

To get your free Moralis Admin Account, click here to register.

👨‍💻 Getting Started

1. Install Dependencies

# NPM
npm i

# Yarn
yarn

2. Environment Variables

Copy .env.example file and rename it to .env and fill in the environment variables.

ETHERSCAN_API_KEY=xxx
POLYGONSCAN_API_KEY=xxx
BSCSCAN_API_KEY=xxx
FTMSCAN_API_KEY=xxx
SNOWTRACE_API_KEY=xxx
MORALIS_SPEEDY_NODES_KEY=xxx
ARCHIVE=false

3. Compile the Smart Contracts

# NPM
npm run compile

# Yarn
yarn compile

🚀 Deployment

In order to deploy the smart contracts, run the following command.

# NPM
npm run migrate --network <network-name>

# Yarn
yarn migrate --network <network-name>

where network-name is based on truffle-config.js. Once the smart contracts are successfully deployed on-chain, then optionally verify the smart contracts with the following command.

# NPM
npm run verify <smart-contract-name> --network <network-name>

# Yarn
yarn verify <smart-contract-name> --network <network-name>

where smart-contract-name is the name of the smart contract from Solidity that you would like to verify and network-name is similar to above.

⚗️ Testing

All the testing scripts are under the test folder. To run the test run the following commands:

// NPM
$ npm run test

// Yarn
$ yarn test

📜 License

GNU Affero General Public License v3.0