Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVMScripts: check byte lengths, avoid returning unallocated memory, and forward error data #496

Merged
merged 31 commits into from Apr 5, 2019
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1b99fc9
EVMScriptRegistry: check script bytes
sohkai Mar 20, 2019
a6479ff
CallsScript: add script length check before access address and callda…
sohkai Mar 20, 2019
cce5b25
EVMScriptRunner: always allocate new memory for decoding return
sohkai Mar 20, 2019
1f5e488
cosmetic: fix comment spacing
sohkai Mar 20, 2019
f955b3d
EVMScriptRunner: fix copying of script's return data
sohkai Mar 26, 2019
3dcbf29
Update test/evm_script.js
facuspagnuolo Mar 26, 2019
c8438f2
cosmetic(test): clarify encodeCallScript's underflow generators
sohkai Mar 26, 2019
ae703f0
Revert "EVMScriptRunner: fix copying of script's return data"
sohkai Apr 2, 2019
8f4783c
CallsScript: cosmetic improvements
sohkai Apr 2, 2019
f73c45a
EVMScriptRunner: add comments for ABI decoding return data
sohkai Apr 2, 2019
335c8d3
CallsScript: clarify why it can only be accessed via a delegatecall
sohkai Apr 2, 2019
80d66bb
test: rename mock executor app to be an app stub
sohkai Apr 3, 2019
2c2b42e
test: EVMScripts cosmetic restructuring
sohkai Apr 3, 2019
e61eda3
test: cosmetic whitespace changes for evmscript tests
sohkai Apr 3, 2019
504da47
test: use new assertThrow module for evmscript tests
sohkai Apr 3, 2019
9a24aa7
test: add revert strings helpers
sohkai Apr 3, 2019
159bb8a
EVMScriptRegistry: reorder error string declarations
sohkai Apr 3, 2019
add1df4
test: add revert string tests to evmscript
sohkai Apr 3, 2019
e054867
test: restructure evmscript tests to separate tests for EVMScriptRegi…
sohkai Apr 3, 2019
4c911b0
Merge branch 'dev' into evmscript-bytes
sohkai Apr 3, 2019
c228edf
test: cosmetic reordering of some evmscript tests
sohkai Apr 3, 2019
caa7383
test: move creation of executionTarget in evmscripts tests to only wh…
sohkai Apr 3, 2019
b5c8731
test: rename executor app to script runner app to avoid confusion in …
sohkai Apr 3, 2019
cecb700
test: test returned bytes from evmscript runners
sohkai Apr 3, 2019
175f772
test: skip revert error checking on coverage
sohkai Apr 3, 2019
99f9865
EVMScriptRunner, CallsScript: transparently revert errors rather than…
sohkai Apr 4, 2019
594329c
CallsScript: use default revert string if call errored without any er…
sohkai Apr 4, 2019
27b0bbb
Update contracts/evmscript/executors/CallsScript.sol
izqui Apr 5, 2019
6164583
CallsScript: clarify manipulation of memory for manual error message
sohkai Apr 5, 2019
6376395
EVMScriptRunner: optimize free memory pointer placement after executo…
sohkai Apr 5, 2019
5706132
EVMScriptRunner: remove comment for extract bytes as it's not relevan…
sohkai Apr 5, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

CallsScript: cosmetic improvements

  • Loading branch information...
sohkai committed Apr 2, 2019
commit 8f4783cf6a5486af679e337910d8690644bebf6b
@@ -35,7 +35,7 @@ contract CallsScript is BaseEVMScriptExecutor {

address contractAddress = _script.addressAt(location);
// Check address being called is not blacklist
for (uint i = 0; i < _blacklist.length; i++) {
for (uint256 i = 0; i < _blacklist.length; i++) {
require(contractAddress != _blacklist[i], ERROR_BLACKLISTED_CALL);
}

@@ -53,7 +53,15 @@ contract CallsScript is BaseEVMScriptExecutor {

bool success;
assembly {
success := call(sub(gas, 5000), contractAddress, 0, calldataStart, calldataLength, 0, 0)
success := call(
sub(gas, 5000), // forward gas left - 5000
contractAddress, // address
0, // no value
calldataStart, // calldata start
calldataLength, // calldata length
0, // don't write output
0 // don't write output
)
}

require(success, ERROR_CALL_REVERTED);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.