Comparing version 0.4.5 to 0.4.6
{ | ||
"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 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
230492
5765
+ Added@types/node@22.10.2(transitive)
+ Addedelliptic@6.5.4(transitive)
+ Addedethers@4.0.49(transitive)
+ Addedhash.js@1.1.3(transitive)
+ Addedscrypt-js@2.0.4(transitive)
- Removed@types/node@22.10.1(transitive)
- Removedelliptic@6.3.3(transitive)
- Removedethers@3.0.29(transitive)
- Removedinherits@2.0.1(transitive)
- Removedscrypt-js@2.0.3(transitive)
Updatedethers@^4.0.27