Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remix-lib

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remix-lib - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6

4

package.json
{
"name": "remix-lib",
"version": "0.4.5",
"version": "0.4.6",
"description": "Ethereum IDE and tools for the web",

@@ -22,3 +22,3 @@ "contributors": [

"ethereumjs-vm": "3.0.0",
"ethers": "^3.0.15",
"ethers": "^4.0.27",
"fast-async": "^6.1.2",

@@ -25,0 +25,0 @@ "solc": "^0.5.0",

'use strict'
var ethJSUtil = require('ethereumjs-util')
var ethers = require('ethers')

@@ -42,6 +41,6 @@ var txHelper = require('./txHelper')

var eventABI = {}
var abi = new ethers.Interface(contract.abi)
var abi = new ethers.utils.Interface(contract.abi)
for (var e in abi.events) {
var event = abi.events[e]
eventABI[ethJSUtil.sha3(Buffer.from(event.signature)).toString('hex')] = { event: event.name, inputs: event.inputs, object: event }
eventABI[event.topic.replace('0x', '')] = { event: event.name, inputs: event.inputs, object: event, abi: abi }
}

@@ -68,2 +67,17 @@ return eventABI

_stringifyBigNumber (value) {
return value._ethersType === 'BigNumber' ? value.toString() : value
}
_stringifyEvent (value) {
if (value === null || value === undefined) return ' - '
if (value._ethersType) value.type = value._ethersType
if (Array.isArray(value)) {
// for struct && array
return value.map((item) => { return this._stringifyEvent(item) })
} else {
return this._stringifyBigNumber(value)
}
}
_decodeEvents (tx, logs, contractName, compiledContracts, cb) {

@@ -76,5 +90,10 @@ var eventsABI = this._eventsABI(compiledContracts)

var topicId = log.topics[0]
var abi = this._event(topicId.replace('0x', ''), eventsABI)
if (abi) {
events.push({ from: log.address, topic: topicId, event: abi.event, args: abi.object.parse(log.topics, log.data) })
var eventAbi = this._event(topicId.replace('0x', ''), eventsABI)
if (eventAbi) {
var decodedlog = eventAbi.abi.parseLog(log)
let decoded = {}
for (const v in decodedlog.values) {
decoded[v] = this._stringifyEvent(decodedlog.values[v])
}
events.push({ from: log.address, topic: topicId, event: eventAbi.event, args: decoded })
} else {

@@ -81,0 +100,0 @@ events.push({ from: log.address, data: log.data, topics: log.topics })

@@ -133,2 +133,3 @@ /* global ethereum */

else if (id === '4') name = 'Rinkeby'
else if (id === '5') name = 'Görli'
else if (id === '42') name = 'Kovan'

@@ -135,0 +136,0 @@ else name = 'Custom'

@@ -33,3 +33,3 @@ 'use strict'

if (funABI.type === 'fallback') return '0x'
var abi = new ethers.Interface([funABI])
var abi = new ethers.utils.Interface([funABI])
abi = abi.functions[funABI.name]

@@ -36,0 +36,0 @@ return abi.sighash

@@ -50,3 +50,3 @@ var async = require('async')

personalMode: () => {
return this.config.get('settings/personal-mode')
return this._deps.config.get('settings/personal-mode')
}

@@ -74,3 +74,3 @@ })

if (!executionContext.isVM()) {
if (!this.config.get('settings/personal-mode')) {
if (!this._deps.config.get('settings/personal-mode')) {
return cb('Not running in personal mode')

@@ -77,0 +77,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc