Clear Developer Guide
  • Clear Developer Guide
  • Deploy Contract
    • Quick start
    • Configure Contract
    • Contract Upgrade
    • Contract Address
  • Configure contract parameters
    • Configure Contract Parameters
  • Interact with the contract
    • OPTION
      • Market Maker
      • User
    • NOTE
      • Fund Manager
      • LP User
  • Contract reference
    • Oracle
    • Index Contract
    • Option Contract
    • Market Maker Contract
    • Note Contract
  • APIs
    • Configure
    • Price
    • User
    • Market Maker
    • Index
    • Option parameter configuration
    • Faucet
Powered by GitBook
On this page
  • Quick start
  • Deploy option contract
  • Deploy environment
  • Private Key and network
  1. Deploy Contract

Quick start

PreviousClear Developer GuideNextConfigure Contract

Last updated 3 years ago

Quick start

Deploy option contract

  • Clone the clear contract repository.

  • Install system dependencies.

  • Customize the deployment script to meet your desired contract design.

  • Get the URL of the Ethereum node.

  • Deploy the script on the testnet.

  • Run the deployment script to deploy to the mainnet.

Deploy environment

Tools

Before starting the following steps, you need to install git 、 node (v10.*.* and later). To compile the source code, you need to install truffle

	npm install -g truffle

Project source code

Run the following command to clone the source code of the project to the local

	git clone https://github.com/DerivStudio/contracts

After entering the newly cloned project, run the following command to install the environment dependencies

npm install --save

Private Key and network

By creating a private key through metamask or other methods, you can use any network that supports the solidity language to deploy your contract. If you use the token price to make an index, you need to make sure that the network you chose has an available oracle. The networks currently deployed by Clear include ETH, BSC and Abitrum (kovan, rinkeby and ropsten test networks), or private chains. After selecting the network, choose a reliable node. You can use geth to synchronize node or use a node similar to infura.

repo