GithubHelp home page GithubHelp logo

oluwanisola / superbots_sc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from upbots/superbots_sc

0.0 0.0 0.0 962 KB

Smart contract for superbots

License: GNU General Public License v3.0

Shell 0.05% JavaScript 55.50% Solidity 44.46%

superbots_sc's Introduction

banner

codecov build&tests License: GPL v3

JoyStickDAO Smart Contracts v1

This repo contains the smart contracts making up JoyStickDAO.

Repository is organized as follows:

  • /contracts/test/- contracts used for tests.
  • /contracts/seed/- JoyStick Launch seed module contracts.
  • /contracts/utils/- utility contracts.
  • /docs/- additional documentation.

Development

requires

node >= 12.0

to install node modules

npm i

to compile run

npm run compile

to test

npm run test

to run coverage

npm run coverage

Environment setup

please prepare .env file

touch .env

and add the following

INFURA_KEY = infura key
MNEMONIC = mnemonic (choose our development mnemonic to be able to interact with the deployed contracts with the deployer address)
PK = private-key
ETHERSCAN_API_KEY = etherscan key

Note:.env should be created in root directory.

Deployment

This project uses the hardhat-deploy plugin to deploy contracts. When a contract has been deployed, it is saved as JSON to the deployments directory, including its address as well as its abi.

Since this is a project that is continuously being extended, it is generally not desirable to always deploy all contracts. Therefore, this project makes use of deployment tags. These are specified at the end of each deploy script.

There are two npm scripts that facilitate the deployment to mainnet and rinkeby. Both require the specification of tags. When using these scripts, at the end of the deployment, it automatically exports the addresses & artifacts in one file per network. These files can be found in the exports directory and, for example, can be used for dApp development.

If multiple contracts share the same ABI (e.g. multiple instances of an ERC20 token) this should be specified in deploy/sharedAbiConfig.js. If not yet available, you should manually add the shared ABI (e.g. the ERC20 ABI) to exports/sharedAbis.json. As a result, the deployment information is exported, the exports for contracts that share the same ABI will point to this shared ABI. This keeps file exports slim, which is beneficial for dApp performance. If this is still unclear, you could for example take a look at exports/rinkeby.json and look at the ABIs of the Dai and Weth contracts.

Deployment to rinkeby

General (one tag): npm run deploy:contracts:rinkeby --tags=<YOUR_TAG_NAME>

General (multiple tags): npm run deploy:contracts:rinkeby --tags=<YOUR_TAG_NAME1>,<YOUR_TAG_NAME2>

Example (deploys Migration contracts): npm run deploy:contracts:rinkeby --tags=Migration

Deployment to kovan

General (one tag): npm run deploy:contracts:kovan --tags=<YOUR_TAG_NAME>

General (multiple tags): npm run deploy:contracts:kovan --tags=<YOUR_TAG_NAME1>,<YOUR_TAG_NAME2>

Example (deploys Migration contracts): npm run deploy:contracts:kovan --tags=Migration

Deployment to mainnet

General (one tag): npm run deploy:contracts:mainnet --tags=<YOUR_TAG_NAME>

General (multiple tags): npm run deploy:contracts:mainnet --tags=<YOUR_TAG_NAME1>,<YOUR_TAG_NAME2>

Example (deploys Seed and Migration contracts): npm run deploy:contracts:mainnet --tags=Seed,Migration

Interacting with contracts

This project uses hardhat tasks to interact with deployed contracts. The associated scripts can be found in the tasks directory. To get an overview of all existing tasks you can run npx hardhat on your command line.

To get more information on specific tasks (e.g. what they do, which parameters they require etc.) you can run npx hardhat help <task_name>.

Here's an example of a command to execute a task on rinkeby: npx hardhat --network rinkeby changeOwner --address <0xsome_address>

Verify Contracts

to verify contracts, the enviornment variable should contain ETHERSCAN_API_KEY set.

npx hardhat verify --network mainnet <0xsome_contract_address>

single constructor argument can be passed as follows: npx hardhat verify --network mainnet <0xsome_contract_address> "Constructor argument 1"

multiple constructor arguments can be passed as follows: npx hardhat verify --network rinkeby 0xa1C2eab7286dB99F481682e8165d2F1F61C4D7Ad "JoyStickDAO Rating Reputation" "PRR"

find more information in the documentation of hardhat-etherscan

Code formatting

To format JS and Solidity code, run the following command:

npm run format

Contributing to JoyStickDAO

If you wish to contribute to JoyStickDAO, check out our Contributor Onboarding documentation.

License

Copyright 2020 JoyStick Foundation

Licensed under the GNU General Public License v3.0.
You may obtain a copy of this license at:

https://www.gnu.org/licenses/gpl-3.0.en.html

superbots_sc's People

Contributors

joshua8321 avatar alextim1218 avatar gourraguis 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.