Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
73849adc
Unverified
Commit
73849adc
authored
Apr 24, 2018
by
yann300
Committed by
GitHub
Apr 24, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #772 from ethereum/fixRevertDecoding1
Use ethers to decode revert reason
parents
c0297d9d
3d214db1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
txExecution.js
remix-lib/src/execution/txExecution.js
+3
-2
No files found.
remix-lib/src/execution/txExecution.js
View file @
73849adc
'use strict'
var
eth
JSABI
=
require
(
'ethereumjs-abi
'
)
var
eth
ers
=
require
(
'ethers
'
)
module
.
exports
=
{
/**
...
...
@@ -86,7 +86,8 @@ module.exports = {
var
returnData
=
txResult
.
result
.
vm
.
return
// It is the hash of Error(string)
if
(
returnData
&&
(
returnData
.
slice
(
0
,
4
).
toString
(
'hex'
)
===
'08c379a0'
))
{
var
reason
=
ethJSABI
.
rawDecode
([
'string'
],
returnData
.
slice
(
4
))[
0
]
var
abiCoder
=
new
ethers
.
utils
.
AbiCoder
()
var
reason
=
abiCoder
.
decode
([
'string'
],
returnData
.
slice
(
4
))[
0
]
msg
=
`\tThe transaction has been reverted to the initial state.\nReason provided by the contract: "
${
reason
}
".`
}
else
{
msg
=
`\tThe transaction has been reverted to the initial state.\nNote: The constructor should be payable if you send value.`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment