Code Monkey home page Code Monkey logo

owl-token's Introduction

OWL Token

The OWL token and related smart contracts.

The token and contract can be in Etherscan:

Setup and show the networks

# Install dependencies
yarn install

# Compile and restore the network addresses
yarn restore

# Show current network addresses
yarn networks

Execute migrations into a local ganache-cli

# Run ganache CLU
yarn rpc

# Execute the migrations
yarn migrate

# Or you can do all at once using
yarn migrate-all

Change the lock period time - re-deployment

The deployment script has an environemt variable LOCK_END_TIME that allows you to set a different lock period (30 days by default).

# Deploy for develop with a given end time for lock period
# flag --reset is NECESSARY as you are re-deploying
# 24H format, please be careful!
LOCK_END_TIME='2018-06-12T16:00:00+02:00' yarn migrate --reset
(npm) > LOCK_END_TIME='2018-06-12T16:00:00+02:00' npm run migrate -- --reset

Generate a new version

# In a release branch (i.e. release/vX.Y.X)
# Migrate the version to the testnets, at least rinkeby, and posibly mainnet
# You can optionally change the gas price using the GAS_PRICE_GWEI env variable
# if you are changing LOCK_END_TIME here, flag --reset is NECESSARY as you are re-deploying
yarn restore
MNEMONIC=$MNEMONIC_OWL yarn migrate --network rinkeby
(npm) > MNEMONIC=$MNEMONIC_OWL npm run migrate -- --network rinkeby

# Extract the network file
yarn networks-extract

# Verify the contract in Etherscan
# Folow the steps in "Verify contract"

# Commit the network file
git add networks.json
git commit -m 'Updated the networks file'
> OR simply git commit -am 'Updated networks file'

# Generate version using Semantic Version: https://semver.org/
# For example, for a minor version
npm version minor
git push && git push --tags

# Deploy npm package
npm publish --access=public

# Merge tag into develop, to deploy it to production, also merge it into master
git checkout develop
git merge vX.Y.X

Verify contract manually

NOTE: For mainnet is better to use the automatic verification script (see next section)

Flatten the smart contract:

npx truffle-flattener contracts/5/TokenOWL.sol > build/TokenOWL-EtherScan.sol
npx truffle-flattener contracts/5/TokenOWLProxy.sol > build/TokenOWLProxy-EtherScan.sol
npx truffle-flattener contracts/5/OWLAirdrop.sol > build/OWLAirdrop-EtherScan.sol

Go to Etherscan validation page:

Verify contract automatically (mainnet only)

You can use verify-on-etherscan

NOTE: To use the verify You'll need to create an API Key in Etherscan for this step.

API_KEY=your-etherscan-api-key yarn verify

Verify contract on xDAI

Flatten the smart contract:

npx truffle-flattener contracts/4/BridgedTokenOWL.sol > build/BridgedTokenOWL-BlockScout.sol

Go to Blockscout validation page:

  • Go to https://blockscout.com/poa/xdai/address/<address>/contract_verifications/new
  • Fill the information:
    • Use BridgedTokenOWL-BlockScout.sol
    • Compiler version: v0.4.24+commit.e67f0147
    • EVM Version: default
    • Optimization: Yes, Runs 200
    • Try to fetch contructor arguments automatically: Yes
  • Press validate

Change the owner

There's a script to change the OWL owner:

For example, to change the owner in rinkeby to 0xb65d2c1a4756ee857fca057ef561758b42277f5e:

# Dry run 
MNEMONIC=$MNEMONIC_OWL yarn change-owner --owner 0xb65d2c1a4756ee857fca057ef561758b42277f5e --network rinkeby --dry-run

# Run the transaction
MNEMONIC=$MNEMONIC_OWL yarn change-owner --owner 0xb65d2c1a4756ee857fca057ef561758b42277f5e --network rinkeby

License

LGPL v3

owl-token's People

Contributors

anxolin avatar bh2smith avatar cag avatar dependabot[bot] avatar fleupold avatar hacker-dom avatar jdetychey avatar josojo avatar velenir avatar w3stside 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.