<commit_before>var $ = require('jquery');
var EthJSVM = require('ethereumjs-vm');
var Trie = require('merkle-patricia-tree');
var ethJSUtil = require('ethereumjs-util');
var EthJSTX = require('ethereumjs-tx');
var ethJSABI = require('ethereumjs-abi');
var EthJSBlock = require('ethereumjs-block');

function UniversalDApp (contracts, options) {
    this.options = options || {};
    this.$el = $('<div class="udapp" />');
    this.contracts = contracts;
    this.renderOutputModifier = options.renderOutputModifier || function (name, content) { return content; };

    this.web3 = options.web3;
    if (!this.web3) {
       throw new Error('Web3 is required for ABI encoding');
    }

    if (options.mode === 'vm') {
        // FIXME: use `options.vm` or `this.vm` consistently
        options.vm = true;

        this.accounts = {};

        this.BN = ethJSUtil.BN;
        this.stateTrie = new Trie();
        this.vm = new EthJSVM(this.stateTrie, null, { activatePrecompiles: true });<commit_msg>Web3 isn't a requirement anymore for udapp<commit_after>var $ = require('jquery');
var EthJSVM = require('ethereumjs-vm');
var Trie = require('merkle-patricia-tree');
var ethJSUtil = require('ethereumjs-util');
var EthJSTX = require('ethereumjs-tx');
var ethJSABI = require('ethereumjs-abi');
var EthJSBlock = require('ethereumjs-block');

function UniversalDApp (contracts, options) {
    this.options = options || {};
    this.$el = $('<div class="udapp" />');
    this.contracts = contracts;
    this.renderOutputModifier = options.renderOutputModifier || function (name, content) { return content; };

    this.web3 = options.web3;

    if (options.mode === 'vm') {
        // FIXME: use `options.vm` or `this.vm` consistently
        options.vm = true;

        this.accounts = {};

        this.BN = ethJSUtil.BN;
        this.stateTrie = new Trie();
        this.vm = new EthJSVM(this.stateTrie, null, { activatePrecompiles: true });
{'fraction_non_alphanumeric': 0.15463917525773196, 'fraction_numerical': 0.0036082474226804126, 'mean_word_length': 3.5244755244755246, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7281808', 'n_tokens_mistral': 625, 'n_tokens_neox': 624, 'n_words': 142}