Giter Club home page Giter Club logo

ethereum-simulator's Introduction

ethereum-simulator

A playground for Ethereum crypto-contracts. Inspect contracts, activate them with a transaction, and try your hand at creating your own.

More information about ethereum available on the forums. Meet others on freenode using a webclient or your own.

I originally built this to help teach myself how crypto-contracts work. Interest from the community has prompted me to develop it into an interactive tutorial. It is still a crude prototype, and a work in progress. Please let me know how we might improve it by filing an issue.

Try

Try the latest version here. Or watch a community-made demo video:

Ethereum Namecoin contract demo

Development

If you want to get this up and running locally, you'll first need a few things:

Next, we can bring down the repo, and install dependencies:

git clone https://github.com/k1n0k0/ethereum-simulator.git
cd ethereum-simulator
npm install

Now let's run it!

npm start

Support

If this simulator helped you understand how ethereum works, please support this project. If you want to learn more about how ethereum works and how you can use it, please support this project. If you think ethereum has the power to change the world, please support this project.

You can help support the development of tools for ethereum education and advocacy by

  • contributing code
  • contributing BTC to the development fund
  • telling more people about the simulator

ethereum-simulator's People

Contributors

k1n0k0 avatar kumavis 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereum-simulator's Issues

Ether, the contract

Recent changes will put the ledger of ether owned into a contract. Wallets are no longer a concept at the protocol layer (well, they are still used in mining).

Selectable templates by having a directory each?

I tried to make each directory a set of templates, but so far it is creating weird bugs.

The bugs seem to care between other_function(functional_function()); and var a=functional_function(); other_function(a);, the former giving an error. Programming languages should in principle not care about that... The latter gives memory leaks issues..

Could do the same as with assets/...

Just like my other issue, probably low priority.

Sub-currency example silently fails

I'm trying to get the sub-currency example from the whitepaper to work and it never runs the contract (storage is never updated), it just accumulates credits from the incoming transactions. There is no indication as to what is failing. It's possible it's a syntax error - I've attempted to adapt the CLL from the whitepaper into JS for the simulator. Here is what I'm submitting as the contract code:

if (tx.value < 100 * block.basefee) {
    return
} else if (contract.storage[1000]) {
    var from = tx.sender
    var to = tx.data[0]
    var value = tx.data[1]
    if (to <= 1000){
        return
    }
    if (contract.storage[from] < value){
        return
    }
    contract.storage[from] = contract.storage[from] - value
    contract.storage[to] = contract.storage[to] + value
} else {
    contract.storage[MYCREATOR] = 10^18
    contract.storage[1000] = 1
}

block.contract_storage() doesn't work

Trying to run the hedge example fails. It seems to be on the block.contract_storage() line, which raises an Uncaught Reference Error "sim is not defined."

Configurable keyboard shortcuts

These would be nice. Perhaps most flexible is to do eventResponse[stringify(event)](enough_state_to_change), and simply have an dictionary of functions as response.

One thing i would like is to be able to use the arrow buttons to navigate between stuff. But i am not sure how to implement that without making things more complicated than they should be.

EVM lang parser

so we can actually calculate crypto fuel burn, and run real contract code

Kickstarter example

An escrow contract that accepts funding from many donors. Funding is forwarded to the author if the funding goal is met before the deadline, otherwise all funds are returned to the backers.

State change triggers:

  • Funding goal (account balance)
  • Funding deadline (time)

Data storage:

  • Funder address + amount

Outcomes:

  • All money goes to author
  • All money goes to funders

Interfacing with the real ethereum blockchain

You could have a 'simulation mode' where you take out the block mechanism and replace it with a 'fake compliant' one.

Ethereum scripts, fees would automatically work the same as in ethereum because it essentially is ethereum.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

trace execution

Would it be possible to get a trace of the code execution as part of the output?
I'm imagining source line (with line number) on the left and corresponding evaluation and result on the right.

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.