Safe, simple, flexible building-blocks for smart-contract systems.

ds-auth ds-guard ds-roles
ds-token ds-vault
ds-cache ds-value
ds-exec ds-math ds-note ds-proxy ds-stop ds-thing


An ERC20 Token with wholesome memes

Provides a standard ERC20 token interface plus DSAuth-protected mint and burn functions; binary approval via MAX_UINT; as well as push, pull and move aliases for transferFrom operations.

Custom Actions


credit tokens at an address whilst simultaniously increasing totalSupply (requires auth)


debit tokens at an address whilst simultaniously decreasing totalSupply (requires auth)



transfer an amount from msg.sender to a given address (requires trust or approval)


transfer an amount from a given address to msg.sender (requires trust or approval)


transfer an amount from a given src address to a given dst address (requires trust or approval)

  /// token.sol -- ERC20 implementation with minting and burning

// Copyright (C) 2015, 2016, 2017  DappHub, LLC

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.4.13;

import "ds-stop/stop.sol";

import "./base.sol";

contract DSToken is DSTokenBase(0), DSStop {

    bytes32  public  symbol;
    uint256  public  decimals = 18; // standard token precision. override to customize

    function DSToken(bytes32 symbol_) public {
        symbol = symbol_;

    event Mint(address indexed guy, uint wad);
    event Burn(address indexed guy, uint wad);

    function approve(address guy) public stoppable returns (bool) {
        return super.approve(guy, uint(-1));

    function approve(address guy, uint wad) public stoppable returns (bool) {
        return super.approve(guy, wad);

    function transferFrom(address src, address dst, uint wad)
        returns (bool)
        if (src != msg.sender && _approvals[src][msg.sender] != uint(-1)) {
            _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);

        _balances[src] = sub(_balances[src], wad);
        _balances[dst] = add(_balances[dst], wad);

        Transfer(src, dst, wad);

        return true;

    function push(address dst, uint wad) public {
        transferFrom(msg.sender, dst, wad);
    function pull(address src, uint wad) public {
        transferFrom(src, msg.sender, wad);
    function move(address src, address dst, uint wad) public {
        transferFrom(src, dst, wad);

    function mint(uint wad) public {
        mint(msg.sender, wad);
    function burn(uint wad) public {
        burn(msg.sender, wad);
    function mint(address guy, uint wad) public auth stoppable {
        _balances[guy] = add(_balances[guy], wad);
        _supply = add(_supply, wad);
        Mint(guy, wad);
    function burn(address guy, uint wad) public auth stoppable {
        if (guy != msg.sender && _approvals[guy][msg.sender] != uint(-1)) {
            _approvals[guy][msg.sender] = sub(_approvals[guy][msg.sender], wad);

        _balances[guy] = sub(_balances[guy], wad);
        _supply = sub(_supply, wad);
        Burn(guy, wad);

    // Optional token name
    bytes32   public  name = "";

    function setName(bytes32 name_) public auth {
        name = name_;

Tools for dapps

We believe that the free software movement is the most important cultural predecessor to the modern-day renaissance in decentralized technologies.

To catalyze the growth of this ecosystem, and to empower hackers to participate, we’re building a comprehensive suite of blockchain-oriented developer tools in the spirit of the Unix philosophy.

Dapp is all you need to start developing for Ethereum. It creates new dapps, runs Solidity unit tests, debugs, deploys, launches testnets, and more.

Seth is a handy tool for slicing and dicing transactions, querying the blockchain, converting between data formats, performing remote calls, and other everyday tasks.

Hevm is our own EVM implementation with a nimble terminal-based Solidity debugger. It’s used for dapp test and dapp debug.

Dappsys - smart contract building blocks

We also maintain Dappsys, an audited collection of smart contract building blocks designed to complement each other. They include;

Using these proven parts lets us focus on the novel features of the systems we develop. We share Dappsys to benefit the smart contract ecosystem.