This is the official repository for Alps Finance Smart Contracts using Truffle Framework.
Built with 💙 from Alps Finance Developers.
To install the latest version of Node.js, click here and follow the steps.
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
To install truffle, run the following command:
// NPM
npm i -g truffle
// Yarn
yarn global add truffle
To get your free Moralis Admin Account, click here to register.
# NPM
npm i
# Yarn
yarn
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
# NPM
npm run compile
# Yarn
yarn compile
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.
All the testing scripts are under the test
folder. To run the test run the following commands:
// NPM
$ npm run test
// Yarn
$ yarn test