Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createVm (hardfork) {
var stateManager = new StateManagerCommonStorageDump({})
stateManager.checkpoint(() => {})
var vm = new EthJSVM({
activatePrecompiles: true,
blockchain: stateManager.blockchain,
stateManager: stateManager,
hardfork: hardfork
})
vm.blockchain.validate = false
var web3vm = new Web3VMProvider()
web3vm.setVM(vm)
return { vm, web3vm, stateManager }
}
constructor (settings = {}) {
super(settings);
this.status = 'constructing';
this.settings = Object.assign({
name: '@services/ethereum',
stack: []
}, settings);
this._state = {
stack: this.settings.stack
};
this.vm = new VM();
this.status = 'constructed';
}