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
44b09989
Commit
44b09989
authored
Apr 12, 2018
by
Alex Beregszaszi
Committed by
yann300
Apr 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display reason for revert (Solidity 0.4.22 feature)
parent
75a4d125
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
txExecution.js
remix-lib/src/execution/txExecution.js
+8
-0
No files found.
remix-lib/src/execution/txExecution.js
View file @
44b09989
'use strict'
'use strict'
var
ethJSABI
=
require
(
'ethereumjs-abi'
)
module
.
exports
=
{
module
.
exports
=
{
/**
/**
...
@@ -82,7 +83,14 @@ module.exports = {
...
@@ -82,7 +83,14 @@ module.exports = {
msg
=
`\tThe transaction ran out of gas. Please increase the Gas Limit.\n`
msg
=
`\tThe transaction ran out of gas. Please increase the Gas Limit.\n`
ret
.
error
=
true
ret
.
error
=
true
}
else
if
(
exceptionError
===
errorCode
.
REVERT
)
{
}
else
if
(
exceptionError
===
errorCode
.
REVERT
)
{
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
]
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.`
msg
=
`\tThe transaction has been reverted to the initial state.\nNote: The constructor should be payable if you send value.`
}
ret
.
error
=
true
ret
.
error
=
true
}
else
if
(
exceptionError
===
errorCode
.
STATIC_STATE_CHANGE
)
{
}
else
if
(
exceptionError
===
errorCode
.
STATIC_STATE_CHANGE
)
{
msg
=
`\tState changes is not allowed in Static Call context\n`
msg
=
`\tState changes is not allowed in Static Call context\n`
...
...
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