npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dapple-wevm

v1.4.10

Published

an wallet side ethereum VM implementation

Downloads

46

Readme

SYNOPSIS

This is a direct fork of ethereumjs-vm with a few (significant) modifications.

This repository is a Proof-of-Concept for a wallet side EVM execution(WEVM), which brings several use cases which I want to explore in this POC project. Possible use cases could be:

##Deployment-scripting

Why

  • no context switching between development, testing or interacting

Features

  • full solidity features
  • dapples unit testing and integration testing

Example

Considder the setup of the following OnBlockchain Contract:

contract OnBlockchain {
  event owner(address owner);
  function OnBlockchain(bytes construcorrr) {
    owner(msg.sender);
    // hahaha
  }
  function giveMeTHIRTYTWO() constant returns (uint) {
    return 32;
  }
  function giveMeSEVENTEEN(uint integer) returns (uint) {
    return 17;
  }
  function giveMeFOUR() returns (uint) {
    return 4;
  }
}
contract B is Script {
  function B() {

    // deploys a new contract
    OnBlockchain a = new OnBlockchain("123");

    // export the contract address as variable "varname". Its class
    // is automatically inferred
    exportObject("varname", a);

    // as the function giveMeTHIRTYTWO is constant, the function call
    // triggers a call and retrieve a value and export it as the variable
    // name "thirtytwo"
    exportNumber("thirtytwo", a.giveMeTHIRTYTWO());

    // The function giveMeSEVENTEEN is not static, therefore
    // a transaction is triggered. However a return value
    // can be still retrieved and exported (currently not working)
    exportNumber("seventeen_nonstatic", a.giveMeSEVENTEEN(2));

    // If one want to retrieve a return value from a function
    // without triggering a transaction, this can be done either by
    // setting the call flag to true:
    setCalls(true);
    exportNumber("seventeen", a.giveMeSEVENTEEN(3));
    setCalls(false);

    // or exporting the the static calls into a function:
    staticStuff(b);

    // sets the address which triggers the transaction
    setOrigin(0x6deec6383397044107be3a74a6d50d41901f0356);

    // this contract will have 0x6d... as its creator
    OnBlockchain b = new OnBlockchain("123");

    // Interacting with the default server environment is also supported
    // In order for this to work, curl and jq need to be installed
    uint BTC_USD = SH.to_uint("curl -s https://api.coindesk.com/v1/bpi/currentprice.json|jq '.bpi.USD.rate|tonumber|floor'");
    exportNumber("btc_usd", BTC_USD);

    // one can think of different integrations/ apis, which can be provided by
    // dapple with this approach
  }

  // the static flag indicates, that all transactions in this function will be
  // treated as static calls rather then generating a transaction
  function staticStuff(OnBlockchain a) static {
    exportNumber("four", a.giveMeFOUR());
  }
}

This is producing the following output:

NEW   new OnBlockchain(0x313233)
TXR   OnBlockchain(0xac5fce7ae0051acf4dcd81a64523da41e59cc7a5).giveMeSEVENTEEN(2)
ACC   switch origin to 0x6deec6383397044107be3a74a6d50d41901f0356
NEW   new OnBlockchain(0x313233)


exportObject(name a, addr 0xac5fce7ae0051acf4dcd81a64523da41e59cc7a5, class OnBlockchain)
exportNumber(name thirtytwo, number 32)
exportNumber(name seventeen_nonstatic, number 1.13526946735478465913037617028159547472529646787646290075579373593588249133056e+77)
exportNumber(name seventeen, number 17)
exportNumber(name four, number 4)
exportNumber(name btc_usd, number 678)

##Sidechain A sidechain running on Dapphub/ Controlled servers can be used to directly interact with ethereum and dapple. E.g. centralized callbacks can be deployed which are triggered by on blockchain events. external Plugins/ Packages/ Services can be easilly implemented and provided through a standard dapphub api.


    Contract c = new Contract();
    Event(c).on("Trade", "sale");
    ...
  }

  function callback(address sender, string name, uint ammount) on("sale") {
    sms.msg(me, "Got request, sold ${name} for ${ammount}");
  }

Development

WEVM related stuff is located in ./src/. Also ethereumjs-vm's code was modified. To test it for yourself run testrpc in the background and:

cd src
node index.js