Coder Social home page Coder Social logo

makerdao / developerguides Goto Github PK

View Code? Open in Web Editor NEW
632.0 56.0 225.0 5.62 MB

Developer guides to integrate with MakerDAO's smart contracts, SDKs, APIs, products, and partners

License: Apache License 2.0

JavaScript 0.33% Shell 91.48% Makefile 0.10% Roff 6.65% Solidity 1.44%

developerguides's Introduction

Developer Guides and Tutorials

Developers can build a variety of experiences using one or more components of the Maker Protocol. This repo contains guides and tutorials to help you understand various approaches to integrate with the Maker Protocol by interfacing with smart contracts, SDKs, APIs, and products.

All guides are organized in sections and by proficiency levels within each section.

Dai

Dai Savings Rate (DSR)

Vaults

Emergency Shutdown

Maker Protocol / Multi-Collateral Dai

Keepers

Developer Tools

OasisDEX Protocol

Oracles

Governance

Gnosis Multisig Wallet

Contribution guidelines

Submissions of new guides and tutorials are very welcome! Following these guidelines will help us maintain consistency,

  • Include all the sections present in this sample guide
  • Create a folder with one markdown file using the same name
  • Append a number if a guide needs to be split into multiple parts
  • Use markdownlint for ensuring a consistent style in the documents. Rules are found in .markdownlint.json root folder.
  • Use Markdown+Math for Math notations.

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

developerguides's People

Contributors

apoorvlathey avatar bracketjohn avatar brianmcmichael avatar chainmonky avatar cpstl avatar davidutro avatar derek-flossman avatar errows avatar gengshuo avatar godsflaw avatar hbarcelos avatar iamchrissmith avatar ianaz avatar ith-harvey avatar jesseabram avatar kentonprescott avatar kevholder avatar lassebirk avatar levity avatar lollike avatar madumas avatar mxmaster2s avatar natonamco avatar nduchak avatar njokuscript avatar paulrberg avatar seanwbren avatar tyler17 avatar vkr4 avatar zdumitru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

developerguides's Issues

TypeError: Maker.create is not a function

Following the test-chain-guide.md walkthrough in Interacting with Maker Protocol contracts section.
Copy the below example in your js file
Run the file with node vault.js

When I execute the vault.js I have the following error :
~/dev/test$ node vault.js
error TypeError: Maker.create is not a function
at start (/home/david/dev/test/vault.js:8:35)
at Object. (/home/david/dev/test/vault.js:35:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Did I miss something?

DaiFaucet contract mistake

In the DaiFaucet contract, it checks to see if the withdraw_amount parameter is <= 0.1 ether, when it should just be 0.1.

So instead of:
require(withdraw_amount <= 0.1 ether);

It should be:

require(withdraw_amount <= 0.1);

Edit: It's not that simple to work with decimals in Solidity, so I'm not entirely sure what the solution would be. We can still limit it in Ether, but it would have to be much less than 0.1 eth. I will be using 0.0005 eth for mine.

i install the dapp , and when dapp build it errors ,could anyone help me

first i met:
Error: Source file requires different compiler version (current compiler is 0.6.7+commit.b8d736ae.Linux.g++ - note that nightly builds are considered to be strictly less than the released version
--> src/test/flop.t.sol:18:1:
|
18 | pragma solidity ^0.6.12;

...

then I revise all the pragma to a fit range.

then met error:

testt@iZj6catsgyxin8nwhcin6wZ:~/dss$ dapp build

  • dapp clean
  • rm -rf out
  • solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol ds-token/=lib/ds-token/src/ ds-token=lib/ds-token/src/index.sol ds-value/=lib/ds-value/src/ ds-value=lib/ds-value/src/index.sol ds-auth/=lib/ds-token/lib/ds-auth/src/ ds-auth=lib/ds-token/lib/ds-auth/src/index.sol ds-math/=lib/ds-token/lib/ds-math/src/ ds-math=lib/ds-token/lib/ds-math/src/index.sol ds-thing/=lib/ds-value/lib/ds-thing/src/ ds-thing=lib/ds-value/lib/ds-thing/src/index.sol ds-note/=lib/ds-value/lib/ds-thing/lib/ds-note/src/ ds-note=lib/ds-value/lib/ds-thing/lib/ds-note/src/index.sol --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast,metadata /=/ src/flap.sol src/vow.sol src/flop.sol src/dai.sol src/abaci.sol src/end.sol src/test/pot.t.sol src/test/end.t.sol src/test/jug.t.sol src/test/flap.t.sol src/test/vow.t.sol src/test/dog.t.sol src/test/flip.t.sol src/test/fork.t.sol src/test/flop.t.sol src/test/clip.t.sol src/test/dai.t.sol src/test/cure.t.sol src/test/abaci.t.sol src/test/vat.t.sol src/flip.sol src/cat.sol src/pot.sol src/vat.sol src/join.sol src/dog.sol src/clip.sol src/cure.sol src/jug.sol src/spot.sol
    Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
    --> src/test/clip.t.sol:243:1:
    Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
    --> src/test/clip.t.sol:243:1:
    |
    243 | contract ClipperTest is DSTest {
    | ^ (Relevant source part starts here and spans across multiple lines).

Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
--> src/test/cure.t.sol:25:1:
|
25 | contract CureTest is DSTest {
| ^ (Relevant source part starts here and spans across multiple lines).
...

I think it may be because of the optimizer (with a low "runs" value!) but I dont know where is the optimizer it said

Please can someone setup some Sepolia DSR contracts, or setup a guide

Hi, ive been trying to ask in the Maker discord, and Just want to setup some Sepolia testnet DSR contracts so i can upgrade another testnet blockchain that bridges to Sepolia.

So far i have tried to launch the VAT, POT, JOIN contracts, to see if i can send in some DAI which i made, but the permissions seem fine i.e. the auth modifier, but cant seem to send in DAI, its though i haven't quite set something up as it reverts on the vat.move() command. thanks

Error: requests.exceptions.ConnectionError: HTTPSConnectionPool

Hello
I followed your tutorial and got an error:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //93ad48d9e784fd857d160044772e35.eth.rpc.rivet.cloud/:8545 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f7b9ef7cfd0>: Failed to establish a new connection: [Errno -2] Name or service not known',))

This is my .sh file:


#!/bin/bash
/home/user/simple-arbitrage-keeper/bin/simple-arbitrage-keeper \
 --rpc-host 'https://93ad48d884d857d160044772e35.eth.rpc.rivet.cloud/' \
 --eth-from '0xD63e5265f0033FA77a316516f768d26F7f879F6a' \
 --eth-key 'key_file=/home/user/.ethereum/keystore/UTC--2020-10-06T15-07-58.672992832Z--d63e5265ffa77a316516f768d26f7f879f6a' \
 --uniswap-entry-exchange '0x47D4Af3BBaEC0dE4dba5F44ae8Ed2761977D32d6' \
 --uniswap-arb-exchange '0x1D79BcC198281C5F9B52bf24F671437BaDd3a688' \
 --oasis-address '0x4A6bC4e803c62081ffEbCc8d227B5a87a58f1F8F' \
 --oasis-api-endpoint 'https://kovan-api.oasisdex.com' \
 --entry-token '0xC4375B7De8af5a38a93548eb8453a498222C4fF2' \
 --arb-token '0xd0A1E359811322d97991E03f863a0C30C2cF029C' \
 --arb-token-name 'WETH' \
 --min-profit 1 \
 --max-engagement 10 \

what do I do?

Modifications to demo contract

Hey, just went through the docs, got things to work. Just some comments. In the demo contract

contract PotLike {
    function chi() external returns (uint256);
    function rho() external returns (uint256);
    function drip() external returns (uint256);
    function join(uint256) external;
    function exit(uint256) external;
    function pie(address) public view returns (uint);

}

Chi should be sent to view so I can call it later here to get the proper balance

function balance() public view returns (uint256) {
       uint256 pie = pot.pie(address(this)); 
       uint256 chi = pot.chi();
       return pie * chi / RAY;
    }

Anyways thought I would point that out cheers!

Some DAI seem to got stuck :/ :)

Hi Makerdao team.

Thanks for all your great work. It's the first time I encounter an error which I can't solve on my own in this context:

It is about the following transactions

  1. https://etherscan.io/tx/0xfd51cf46707de823824dc6aec3f9fdc887eff2da53fbd8a49bc2b99d7fee84ae
  2. https://etherscan.io/tx/0x0fb05d52c4163ce66f84c261481948b768c068488a9620c92e4c9f7befb39e3b

It seems that the 548.5080525794122 DAI got stuck somewhere :) Can't find them. It would be great if you could help me out.

Kind regards
Michael

A problem encountered when borrowing DAI

After borrowing DAI, I saw the transaction on etherscan, I want to know What do the parameters in the input data mean?

Function: execute(address _target, bytes _data) ***
MethodID: 0x1cff79cd
[0]:  00000000000000000000000082ecd135dce65fbc6dbdd0e4237e0af93ffd5038
[1]:  0000000000000000000000000000000000000000000000000000000000000040
[2]:  00000000000000000000000000000000000000000000000000000000000000c4
[3]:  e685cc040000000000000000000000005ef30b9986345249bc32d8928b7ee64d
[4]:  e9435e3900000000000000000000000019c0976f590d67707e62397c87829d89
[5]:  6dc0f1f10000000000000000000000002f0b23f53734252bda2277357e97e151
[6]:  7d6b042a0000000000000000000000009759a6ac90977b93b58547b4a71c7831
[7]:  7f391a284554482d410000000000000000000000000000000000000000000000
[8]:  00000000000000000000000000000000000000000000000000000001158e4609
[9]:  13d0000000000000000000000000000000000000000000000000000000000000

Fix outdated links in Vault Integration Guide

Mrk.tools Application Error

Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail

Kovan Network deprecated.

It is difficult to follow with the developer guides because it is still using the Kovan Network for demonstration. An obvious suggestion is to switch to goerli.

frob Transaction failed in mcd-seth-01.md

The frob() call failed while running the example of drawing DAI from BAT (mcd-seth-01.md).

The transactionHash is :

0x145283dbfc249b2c2c36b466d4362446f233f30e527e08effdcdf652fabac946

since it is mentionned that

This guide works under the Kovan 1.0.2 Release of the system.

could it be a compatibility issue ?
shall I send more information ?

A problem occurred while interacting with contracts using seth

Hey,

I tried to deploy the Maker testchain using the instructions provided here: https://github.com/makerdao/developerguides/blob/master/devtools/test-chain-guide/test-chain-guide.md. While trying to run the command: seth send -F $ETH_FROM $CDP_MANAGER 'open(bytes32,address)' "$ilk" "$ETH_FROM", I receive the following error: curl: (52) Empty reply from server. If I run the testchain with --verbose the following error is returned when I run the previous seth command:

eth_sendTransaction
Error: Callback was already called.
    at /Users/ritikdutta/Desktop/testchain/node_modules/ganache-cli/build/ganache-core.node.cli.js:62:273
    at s.<anonymous> (/Users/ritikdutta/Desktop/testchain/node_modules/ganache-cli/build/ganache- 
core.node.cli.js:62:2116)
    at s.emit (events.js:314:20)
    at s.destroy (/Users/ritikdutta/Desktop/testchain/node_modules/ganache-cli/build/ganache-core.node.cli.js:32:17222)
    at finish (_stream_writable.js:670:14)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Keeper Bot Set-Up guide severely outdated - faucet on Goerli not set-up correctly either

It currently references the Kovan testnet and I have been trying to get it to work against the Goerli testnet. The faucet on the Goerli testnet seems to not have been set-up correctly for MKR either because it gives 0 MKR, instead of 1 MKR like it should.

Here is the page to the guide I'm refering to: https://github.com/makerdao/developerguides/blob/master/keepers/auction-keeper-bot-setup-guide/auction-keeper-bot-setup-guide.md.

Note: for the address below I used https://chainlog.makerdao.com/

In particular, here is the issue with the faucet:

I ran the following SETH command to try to get MKR token:

seth send 0xa473CdDD6E4FAc72481dc36f39A409D86980D187 'gulp(address)' 0xc5E4eaB513A7CD12b2335e8a0D57273e13D499f7

Here is the transaction, notice that 0 MKR was sent https://goerli.etherscan.io/tx/0xc05bbbd34d1495f05f27e1834dca16e620b4f5c32f3fb6a014fbfc814467e811

As a check against myself, I tried to call the same faucet to get USDC and I was able to get 50000. Here is the command:

seth send 0xa473CdDD6E4FAc72481dc36f39A409D86980D187 'gulp(address)' 0x6fb5ef893d44f4f88026430d82d4ef269543cb23

Here is the transaction https://goerli.etherscan.io/tx/0x49c10dcd637823b90eeeb7e9785f80bbd9e54a48a704d6ea6a9b85c1e51aedf6

My theory:
After looking at the smart contract for the faucet https://goerli.etherscan.io/address/0xa473CdDD6E4FAc72481dc36f39A409D86980D187#code, the amount has not been set by the owner. Here is the smart contract code for gulp:

    function gulp(address gem) external  {
        require(list[address(0)] == 1 || list[msg.sender] == 1, "token-faucet/no-whitelist");
        require(!done[msg.sender][gem], "token-faucet/already-used_faucet");
        require(ERC20Like(gem).balanceOf(address(this)) >= amt[gem], "token-faucet/not-enough-balance");
        done[msg.sender][gem] = true;
        ERC20Like(gem).transfer(msg.sender, amt[gem]);
    }

Any advice for me to proceed or if someone is able to update the docs?

Full deployment of MCD protocol to testnet

I am trying to deploy the full MCD protocol to a tesntet network following this guide

The nix-shell setup is not really working in my environment (getting bunch of different errors), hence the smart contract deployment using dss-deploy is not an alternative.

What would be the recommended way for deploying the MCD smart contracts without dss-deploy ?

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.