Commit Graph

254 Commits

Author SHA1 Message Date
chriseth
2308904f68 Remove "using namespace" from header and move Instruction to dev::eth. 2019-03-28 13:48:11 +01:00
chriseth
2e7794d8a6 Defensively pad memory for `type(C).name` to multiples of 32. 2019-03-13 18:51:32 +01:00
Daniel Kirchner
66fc7ffab2 Allow dynamically encoded calldata structs with ABIEncoderV2. 2019-03-11 16:40:13 +01:00
Daniel Kirchner
f7c6eda2c3 Allow calldata arrays with dynamically encoded base type. 2019-03-06 18:04:12 +01:00
Alex Beregszaszi
a96cc6e0e8 Add allocateMemory helper with value known at compile time 2019-03-04 17:46:42 +01:00
Alex Beregszaszi
cf5c13f9c7 Introduce global optimiser settings. 2019-03-04 11:40:28 +01:00
Mathias Baumann
e4a52aa2f6 Allow dynamic types in public mappings 2019-02-26 15:48:54 +01:00
Alex Beregszaszi
d2f493268b Provide access to the name of contracts. 2019-02-26 14:07:03 +00:00
chriseth
05541e5adb Fixed internal error related to ecrecover and ABIEncoderV2. 2019-02-19 14:17:03 +01:00
chriseth
d5791fef41 Fix combination of delegatecall and ABIEncoderV2.
We can set the flag to false for bare delegatecall, because we always
send a memory string and never a storage reference.
2019-02-19 13:57:03 +01:00
chriseth
1a823f0bf8 Fix tabs/spaces. 2019-02-13 17:05:48 +01:00
Daniel Kirchner
0e4912a203 ABIEncoderV2: Implement calldata structs without dynamically encoded members. 2019-02-11 15:46:58 +01:00
chriseth
a8d0ef4bad Allow indexed structs in events with encoder v2. 2019-02-11 11:37:47 +01:00
chriseth
35483422f3 Pad code to multiple of 32 bytes. 2019-01-30 11:31:28 +01:00
chriseth
e6fee257e6 Code generation for access to contract code. 2019-01-17 20:36:48 +01:00
chriseth
2fcfb216b5 Syntax for meta type information. 2019-01-17 20:36:48 +01:00
chriseth
d8218b7eef Formatting. 2018-12-18 23:50:39 +01:00
Leonardo Alt
ab76676271 Sort includes in libsolidity/codegen 2018-12-17 17:06:11 +01:00
chriseth
73a64da041 Fix bug related to state variables of function type accessed via base contract. 2018-11-29 19:30:27 +01:00
hydai
9326adc3db Replace IntegerType(256) with static function IntegerType::uint256() 2018-11-29 17:07:18 +08:00
Daniel Kirchner
30e6f8d3fb Allow mapping arguments for public and external library functions. 2018-11-26 16:31:46 +01:00
Leonardo Alt
06189ae57f Add assert and tests for bound functions 2018-11-22 14:41:39 +01:00
Christian Parpart
d67322a186 Introduce namespace langutil in liblangutil directory.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
2018-11-21 19:13:44 +00:00
chriseth
6bbedab383
Merge pull request #5265 from ethereum/cleanupsha3
Simplify sha3.
2018-11-09 15:39:57 +01:00
Christian Parpart
f112377dd4
Refactor solidity::Token into an enum class with TokenTraits helper namespace 2018-10-22 17:00:51 +02:00
chriseth
e78b95d9d4 Renamed SHA3.{h,cpp} files. 2018-10-18 14:31:36 +02:00
chriseth
97d01d9b47 Assert about some removed language concepts in the code generator. 2018-10-17 22:26:40 +02:00
chriseth
db4f780283
Merge pull request #4962 from anurag-git/anurag_issue_3667-1
Removed default case from "ExpressionCompiler::visit(FunctionCall...)".
2018-10-01 13:24:26 +02:00
liangdzou
44e8dfd393 fix typo 2018-09-20 22:54:57 +08:00
Jordan Last
d0497aacc0 fixing rebase conflicts
add ElementaryTypes::BytesMemory and ElementaryTypes::StringMemory

fix rebase conflicts

fixing rebase conflicts

use make_shared instead of new

fix tabs and StateMutability parameter

create address and addressType functions, fix spaces in comment

fix typo and switch nonpayable to payable

fix spaces

fix comment again
2018-09-13 15:53:06 -06:00
Daniel Kirchner
12aaca1645 Add payable and non-payable state mutability to AddressType. 2018-09-13 15:15:49 +02:00
Anurag Dashputre
b86cea033b Removed default case from "ExpressionCompiler::visit(FunctionCall...)". 2018-09-13 15:40:06 +05:30
chriseth
120438c0cf Always perform cleanup for EXP. 2018-09-10 12:47:46 +02:00
Daniel Kirchner
87804b6419 Split IntegerType into IntegerType and AddressType. 2018-09-05 12:19:14 +02:00
chriseth
e6aa15bae1
Merge pull request #4895 from ethereum/abidecodesingle
Fix abi.decode returning single value.
2018-09-04 23:47:56 +02:00
chriseth
624dbbe142 Fix abi.decode returning single value. 2018-09-04 18:19:00 +02:00
Daniel Kirchner
1ae6ec9038 Remove trailing whitespace. 2018-09-04 17:43:04 +02:00
Daniel Kirchner
82f512a7d4 Add return data to bare calls. 2018-09-04 13:31:10 +02:00
Daniel Kirchner
a102f3b783 Remove trailing whitespace for all files in the repository. 2018-09-04 11:30:30 +02:00
Anurag Dashputre
94c327c1ae Removed unused "FunctionType::Kind::CallCode" from Types.h and all its usage 2018-08-23 13:09:00 +05:30
chriseth
c274af0770
Merge pull request #4825 from ethereum/expressionCompBareCall
More safeguards for (library) function types.
2018-08-16 14:38:44 +02:00
chriseth
455345871d More safeguards for (library) function types. 2018-08-15 17:11:43 +02:00
Daniel Kirchner
7ca0aaaf6f Add `staticcall to address`. 2018-08-15 16:06:48 +02:00
chriseth
9328ea4c3c Add abi.decode(bytes data, (...)) 2018-08-15 10:45:16 +02:00
Alex Beregszaszi
ed52f422b7 Rename FunctionKind SHA3 to KECCAK256 (as the instruction was renamed in libevmasm) 2018-08-08 22:37:40 +01:00
Leonardo Alt
faa9c221d4 Changes in ExpressionCompiler 2018-07-18 19:51:24 +02:00
Alex Beregszaszi
0dd79bc172
Merge pull request #4479 from ethereum/fixFixedPointCrash
Fix handling of fixed point types in arithmetics.
2018-07-12 15:04:16 +01:00
chriseth
7355298c2f Fix handling of fixed point types in arithmetics. 2018-07-11 14:56:53 +02:00
Leonardo Alt
38026d3114 Use STATICCALL for view and pure 2018-07-11 14:45:22 +02:00
Cryptomental
140dbfdbd8 Code, Changelog, ReleaseChecklist: Fix typos.
Refs: #4442
2018-07-11 00:26:23 +02:00
chriseth
85b9d3927a
Merge pull request #4224 from ethereum/revert_wrong_calldata
[BREAKING] Revert if calldata has wrong size
2018-07-02 12:55:22 +02:00
Leonardo Alt
7763d21cc6 Revert if calldata is too short or points out of bounds 2018-06-26 10:27:48 +02:00
chriseth
a55e8c93ce Save double encode call for sha3. 2018-06-25 17:17:18 +02:00
chriseth
23c4142005 Bare functions take single bytes argument. 2018-06-25 17:01:45 +02:00
chriseth
0e66a1ddde Single bytes argument.
In 0.5.0 mode, only accept a single bytes argument for ``.call``,
``keccak256`` and others and do not pad when encoding.
2018-06-25 17:01:45 +02:00
Daniel Kirchner
e84b55bd6f Extend explanatory remark and argue using bitwise operations instead of rounding. 2018-06-12 09:32:19 +01:00
Daniel Kirchner
f33dc92cbd Use proper SAR for signed right shifts and emulate on pre-constantinople. 2018-06-12 09:32:19 +01:00
Erik Kundt
34b5eca1f8 Improves assembly and adds more tests. 2018-05-30 17:40:33 +02:00
bitshift
e9dcfb0b62 Implements pop() for value type arrays. 2018-05-29 12:53:02 +02:00
Alex Beregszaszi
c03a29dea8 Fix revert with reason coming from a string variable 2018-05-09 17:53:17 +02:00
chriseth
2968639406 Removed signed shift right from the utilities. 2018-04-30 20:34:43 +01:00
Alex Beregszaszi
52c9441879 Do not use SAR instead of SDIV in shifts because it rounds differently 2018-04-30 20:34:43 +01:00
Alex Beregszaszi
22bfd3da41 Use native shift instructions on Constantinople 2018-04-30 20:34:43 +01:00
Alex Beregszaszi
0201492bbf Remove redundant cleanup for abi.encode. 2018-04-16 12:47:38 +02:00
chriseth
7054defdd6
Merge pull request #3364 from ethereum/revertWithReason
Revert with reason
2018-04-12 21:01:08 +02:00
chriseth
4faa839813 Use error signature for revert data. 2018-04-12 13:09:38 +02:00
chriseth
7a9ee69e98 Bubble up error messages. 2018-04-12 13:09:38 +02:00
chriseth
ae1d040285 Allow error string for `require`. 2018-04-12 13:09:37 +02:00
chriseth
012ab37fe3 Code generator for revert with reason string. 2018-04-12 13:09:37 +02:00
Alex Beregszaszi
d56acb68ab Add abi.encode, abi.encodePacked, abi.encodeWithSelector and abi.encodeWithSignature. 2018-04-11 22:32:10 +02:00
chriseth
65f18a18de More specific push implementation. 2018-04-04 16:50:45 +02:00
chriseth
6777f7a57f Optimize across MLOAD if MSIZE is not used. 2018-04-03 14:34:32 +02:00
Alex Beregszaszi
fab527c414 Add runtimeOnly option to pushCombinedFunctionEntryLabel 2018-03-27 04:00:12 +01:00
chriseth
0a67d616db Use shortcut for internal function calls to avoid runtime reference. 2018-03-27 04:00:12 +01:00
chriseth
c2709a2d8e Decode dynamic data. 2018-03-21 14:53:29 +00:00
chriseth
cc2f71e4ac Move dynamic type removal out of the type system. 2018-03-21 14:53:29 +00:00
chriseth
834d63de2c Allow `block.blockhash` without being called. 2018-03-13 17:34:21 +01:00
chriseth
b467116ea8 Use STATICCALL for pure function calls if EVM version supports it and 0.5.0 is activated. 2018-03-06 15:30:18 +01:00
chriseth
f6c0daec14
Merge pull request #3652 from ethereum/gasleft_v2
Use StaticAnalyzer to deprecate msg.gas instead of conditionally remo…
2018-03-06 09:26:14 +01:00
Daniel Kirchner
91b13b734d Use StaticAnalyzer to deprecate msg.gas instead of conditionally removing it in MagicType. 2018-03-05 23:16:26 +01:00
chriseth
be797cb796
Merge pull request #3599 from ethereum/sendAllGasOnByzantium
Send all gas on byzantium
2018-03-05 20:13:52 +01:00
chriseth
3793aa405b
Merge pull request #3643 from ethereum/gasleft
Move msg.gas to global function gasleft(). Closes #2971.
2018-03-05 20:11:37 +01:00
chriseth
83fcf007bf Do not retain any gas in external calls (except if EVM version is set to homestead). 2018-03-05 19:32:12 +01:00
Daniel Kirchner
3340053fd9 Style improvements. 2018-03-05 17:00:37 +01:00
chriseth
6ec4517929 Use EVM version in gas meter and optimizer. 2018-03-05 11:36:33 +01:00
Daniel Kirchner
c633c0eacb Move msg.gas to global function gasleft(). Closes #2971. 2018-03-05 11:18:04 +01:00
chriseth
2b5a5a8669 Make addmod and mulmod revert if the last argument is zero. 2018-02-15 13:52:17 +01:00
chriseth
5916cf1e0a Allow this.f.selector to be pure. 2018-02-13 11:00:59 +01:00
chriseth
6001bd1406 Allocate one byte per memory byte array element instead of 32. 2017-10-16 22:29:31 +02:00
chriseth
69ea5c43f3 Send all gas for 0.5.0. 2017-10-05 11:56:36 +02:00
Alex Beregszaszi
204214f070 Split encodeToMemory to packedEncode and abiEncode 2017-09-27 11:32:19 +01:00
Alex Beregszaszi
a657d3b1a1 Make most of the parameters mandatory in encodeToMemory 2017-09-27 11:15:27 +01:00
Alex Beregszaszi
ee65ecfb3b Ensure that address types are always declared as 160bit 2017-09-26 22:46:33 +01:00
Alex Beregszaszi
cb6cdfe780 Simplify switch statements by refactoring internal break statements 2017-09-25 10:57:21 +01:00
Alex Beregszaszi
74972f5fa6 Avoid switch fallthrough in ExpressionCompiler 2017-09-25 10:51:58 +01:00
Alex Beregszaszi
efa4598c23 Mark functions static 2017-09-20 01:23:21 +01:00
Alex Beregszaszi
fd1f8ab38b Rename .sig to .selector on function types 2017-09-13 11:40:57 +01:00
Alex Beregszaszi
58f7a27ee0 Add sig member on function type 2017-09-13 11:40:57 +01:00
Alex Beregszaszi
79e84a8fa4 Swap declaration/statemutability in FunctionType constructor 2017-08-28 19:43:35 +01:00
Alex Beregszaszi
51d6141f7e Mark to places fall-through 2017-08-25 16:00:36 +01:00