Code Monkey home page Code Monkey logo

spells-mainnet's Introduction

spells-mainnet

Build Status

Staging repo for MakerDAO weekly executive spells.

Instructions

Getting Started

$ git clone [email protected]:makerdao/spells-mainnet.git
$ dapp update

Adding Collaterals to the System

If the weekly executive needs to onboard a new collateral:

  1. Update the onboardNewCollaterals() function in DssSpellCollateral.sol
  2. Update the values in src/test/config.sol
  3. Add onboardNewCollaterals(); in the actions() function in DssSpellAction

Removing Collaterals from the System

If the weekly executive needs to offboard collaterals:

  1. Update the offboardCollaterals() function in DssSpellCollateral.sol
  2. Update the values in src/test/config.sol
  3. Add offboardCollaterals(); in the actions() function in DssSpellAction

Build

$ make

Test (DappTools without Optimizations)

Set ETH_RPC_URL to a Mainnet node.

$ export ETH_RPC_URL=<Mainnet URL>
$ make test

Test (Forge without Optimizations)

Prerequisites

  1. Install Rust.
  2. Install Forge.

Operation

Set ETH_RPC_URL to a Mainnet node.

$ export ETH_RPC_URL=<Mainnet URL>
$ make test-forge

Deploy

Set ETH_RPC_URL to a Mainnet node and ensure ETH_GAS is set to a high enough number to deploy the contract.

$ export ETH_RPC_URL=<Mainnet URL>
$ export ETH_GAS=5000000
$ export ETH_GAS_PRICE=$(seth --to-wei 100 "gwei")
$ make deploy

A few helpful tips to estimate gas. You can use the following to get a gas estimate for the deploy.

make all
make estimate

Once you have that, add another million gas as a buffer against out-of-gas errors. Set ETH_GAS to this value.

export ETH_GAS="$((<value from previous step> + 0))"
export ETH_GAS=$(bc <<< "$ETH_GAS + 1000000")

You should also check current gas prices on your favorite site (e.g. https://ethgasstation.info/) and put that gwei value in the ETH_GAS_PRICE line.

export ETH_GAS_PRICE=$(seth --to-wei 420 "gwei")

Verifying spells on etherscan

The process of verifying code on etherscan is a little bit more involved because of solc's weird behaviour around ABI Encoder v2.

  1. Run make flatten
  2. If your spell didn't use DssExecLib.addNewCollateral you need to tweak the flattened source.
    1. Remove pragma experimental ABIEncoderV2;
    2. Comment out DssExecLib.addNewCollateral method.
  3. Go to etherscan and verify source.
    1. Add library: DssExecLib:0xfD88CeE74f7D78697775aBDAE53f9Da1559728E4
    2. Ensure optimizer is off and optimize runs = 200

spells-mainnet's People

Contributors

brianmcmichael avatar gbalabasquer avatar nanexcool avatar godsflaw avatar kmbarry1 avatar iamchrissmith avatar wilbarnes avatar naszam avatar hexonaut avatar talbaneth avatar julienmartinlevrai avatar andy8052 avatar dizzy avatar e18r avatar krzkaczor avatar wilfredta avatar olivdb 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.