Christian Parpart
22eff22492
liblangutil: extends CharStream to know about the respective (file-)name (and adapt codebase to it)
2018-11-29 12:45:27 +01:00
chriseth
9a94e503da
Merge pull request #5491 from ethereum/libyul-as-library
...
Libyul as static library (version 3 ;( )
2018-11-23 17:01:18 +01:00
Christian Parpart
713d94476e
Reorder some include files and group <libyul/>'s together (as much as possible)
2018-11-23 12:37:19 +01:00
chriseth
bb10be789c
Inject SMTLIB2 queries and responses via standard-json-io.
2018-11-23 09:43:49 +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
Christian Parpart
87821c53c3
Isolating files shared between Yul- and Solidity language frontend.
2018-11-21 18:58:12 +00:00
Alex Beregszaszi
d60cab1983
Add CompilerStack state assertions in internal methods
2018-11-14 10:47:26 +00:00
Alex Beregszaszi
be70703f82
Move lastContractName closer to contractNames
2018-11-14 10:29:16 +00:00
Alex Beregszaszi
5778af07a3
Do not crash on filesystemFriendlyName if no contracts were compiled
2018-11-14 10:29:16 +00:00
Leonardo Alt
9a4fd946c3
Add Scanner function that prints source based on SourceLocation
2018-11-13 13:49:29 +01:00
Daniel Kirchner
74557ceb0e
Deterministic YulStringRepository using string hashes.
2018-11-12 23:43:16 +01:00
chriseth
0f2ba3522f
Reset yul string repository.
2018-11-09 15:40:36 +01:00
Alex Beregszaszi
e732c49c2f
Change find to use a single character
2018-10-09 18:06:25 +01:00
Alex Beregszaszi
d71cc66dde
Use GasEstimator::dataGas in CompilerStack
2018-09-28 00:03:35 +01:00
liangdzou
808c3f3df5
fix some format typos
2018-09-17 22:13:21 +08:00
Daniel Kirchner
954d7433bd
Disallow remappings with empty prefix.
2018-08-10 19:26:48 +02:00
Alex Beregszaszi
9062704054
Merge pull request #4753 from mattaereal/boost-to-string-patch
...
Replace boost:lexical_cast<std::string> for std::to_string.
2018-08-08 16:07:25 +01:00
Matías Aereal Aeón
e902ce1aa0
Removing std:: from std::to_string and include for boost/lexical_cast
2018-08-08 11:26:30 -03:00
chriseth
901550e473
Merge pull request #4692 from ethereum/devcore-path
...
Move absolutePath/sanitizePath helpers from CompilerStack to libdevcore
2018-08-07 16:15:49 +02:00
chriseth
71e26f6adb
Remove clone feature.
2018-08-07 11:10:50 +01:00
Alex Beregszaszi
3de0b8b7f0
Move absolutePath/sanitizePath helpers from CompilerStack to libdevcore
2018-08-06 12:54:22 +01:00
Alex Beregszaszi
f74cff622d
Properly explain all the analsys steps in CompilerStack
2018-07-31 00:39:18 +01:00
Alex Beregszaszi
3fc7da11db
Pull out createCBORMetadata helper
2018-06-25 22:17:33 +02:00
Alex Beregszaszi
a392e0f046
Properly catch optimizer/assembly exception in CompilerStack
2018-06-20 23:19:06 +02:00
Alex Beregszaszi
0a632011be
CompilerStack absolutePath/sanitizePath can be made static
2018-06-20 17:04:22 +02:00
Alex Beregszaszi
dcee8e11ad
Reorder some of the flow in CompilerStack::compileContract for readability
2018-06-20 17:01:17 +02:00
Daniel Kirchner
16e966dea0
Add control flow analyzer and test for uninitialized storage returns.
2018-05-14 20:23:40 +02:00
Daniel Kirchner
995623f0fa
Add control flow graph.
2018-05-14 20:23:40 +02:00
Alex Beregszaszi
3730f68d4b
reindent
2018-04-06 13:52:19 +02:00
Alex Beregszaszi
e8be0e61b3
Catch FatalError in CompilerStack::analysis to cover all the analysis tests
2018-04-06 13:52:19 +02:00
chriseth
6ec4517929
Use EVM version in gas meter and optimizer.
2018-03-05 11:36:33 +01:00
chriseth
a53d6b499d
Use EVM version in type checker.
2018-03-01 17:19:35 +01:00
chriseth
f75a411325
Provide target EVM version in CompilerContext.
2018-03-01 17:19:35 +01:00
chriseth
85785710e6
Store EVM version in settings.
2018-03-01 17:19:34 +01:00
chriseth
5ab4a1ae78
Add ability to set the target EVM version.
2018-03-01 17:19:34 +01:00
chriseth
6807010dc7
Prevent libraries from being called.
2018-01-19 16:27:44 +01:00
Alex Beregszaszi
8d3cfa8cff
Simplify contract lookup in CompileStack
2017-10-18 23:54:32 +01:00
Alex Beregszaszi
2ce35b77be
Implement CompilerStack.lastContractName()
2017-10-18 23:54:32 +01:00
Alex Beregszaszi
f96e932243
Provide optional list of contract names to CompilerStack.compile
2017-10-04 20:30:14 +01:00
chriseth
3f3bcc4f8a
Merge pull request #2848 from ethereum/checkViewPure
...
Enforce view and pure.
2017-09-13 18:29:13 +02:00
Alex Beregszaszi
bbfb16cf5c
Introduce assemblyString
2017-09-11 15:53:20 +01:00
Alex Beregszaszi
50570c6c79
Do not return the stream in asssemblyStream
2017-09-11 15:48:58 +01:00
Alex Beregszaszi
a535a8b06e
Split out the JSON functionality from assembly.stream()
2017-09-11 15:48:52 +01:00
chriseth
5470da4d9a
View-pure checker.
2017-09-06 13:50:49 +02:00
Alex Beregszaszi
8e5f9c5981
Removed unused natspec members of ContractDefinition
2017-08-25 20:29:43 +01:00
Alex Beregszaszi
e6f55fb95e
Do not create a new TypeChecker instance for every contract
2017-08-25 15:43:26 +01:00
Alex Beregszaszi
670df8e874
Attach natspec before type checking
2017-08-25 15:39:20 +01:00
Alex Beregszaszi
d60d4b3031
Remove duplicate work from CompilerStack.analyze()
2017-08-25 15:37:10 +01:00
chriseth
9ac2ac14c1
Rename read file callback.
2017-08-23 17:37:35 +02:00
chriseth
b3f8ed457a
Cleanup.
2017-08-23 14:24:30 +02:00
chriseth
1ece7bf443
z3 conditions
2017-08-23 14:24:04 +02:00
Alex Beregszaszi
4219acaba9
Merge pull request #2771 from ethereum/unused-includes
...
Remove some unused includes
2017-08-21 16:26:44 +01:00
Alex Beregszaszi
b3986f1d07
Remove some unused includes
2017-08-21 14:08:58 +01:00
Alex Beregszaszi
7222fac456
Remove DocumentationType from natspec
2017-08-15 19:56:38 +01:00
Alex Beregszaszi
2d1bab0de8
Output experimental flag in metadata only for risky features
2017-08-11 16:38:43 +01:00
Alex Beregszaszi
4d82d4f57a
Store experimental flag in metadata CBOR
2017-08-11 16:38:43 +01:00
Alex Beregszaszi
c835bcec62
Replace isFullyImplemented with unimplementedFunctions in ASTAnnotations
2017-08-04 14:03:37 +01:00
Alex Beregszaszi
9fc6eccc26
Add isFallback() helper
2017-07-27 21:52:57 +01:00
Alex Beregszaszi
89fadd6935
Merge pull request #2645 from ethereum/asserts
...
Use solAssert where possible
2017-07-27 11:12:30 +01:00
Yoichi Hirai
85b338a019
Merge pull request #2643 from ethereum/compilerstack
...
Reorder CompilerStack to be in logical order
2017-07-27 11:28:08 +02:00
chriseth
1298a8df14
Merge pull request #2566 from ethereum/metadata-only-relevant
...
Metadata: only include relevant files in the source list
2017-07-27 11:07:15 +02:00
Alex Beregszaszi
8098030986
Use solAssert instead of boost throw where possible
2017-07-26 22:23:21 +01:00
Alex Beregszaszi
9982e73dce
Reorder CompilerStack to be in logical order
2017-07-26 22:16:02 +01:00
Alex Beregszaszi
30012db396
Add CompilerStack::setOptimiserSettings
2017-07-26 15:17:07 +01:00
Alex Beregszaszi
6848199b66
Add CompilerStack::setLibraries
2017-07-26 15:05:16 +01:00
Alex Beregszaszi
fa5a7efb45
Remove unused interfaces from CompilerStack
2017-07-26 15:05:16 +01:00
Alex Beregszaszi
c617336587
Only include files usde in metadata
2017-07-19 14:56:40 +01:00
Yoichi Hirai
2a46e1b0e2
Merge pull request #2589 from ethereum/rename-onchainmetadata
...
Rename onChainMetadata to metadata
2017-07-19 11:43:19 +02:00
Alex Beregszaszi
5bb4bfb08b
Remove unneccesary interface from Natspec
2017-07-18 21:05:34 +01:00
Alex Beregszaszi
6d8929a71a
Rename onChainMetadata to metadata
2017-07-18 20:54:28 +01:00
Alex Beregszaszi
555dc4f46f
Remove Why3 generator
2017-06-25 12:26:16 +01:00
Alex Beregszaszi
b99e4bc68b
Rework functionHashes into methodIdentifiers
2017-06-22 11:13:06 +01:00
Edward Ruchevits
5f7bca94e5
Reverted functionHashes output to use method signature as keys
2017-06-13 18:04:33 +01:00
Edward Ruchevits
2e816967d3
Allow including hashes of method signatures in --combined-json output
2017-06-13 17:03:17 +01:00
Alex Beregszaszi
998ca552b8
Fix state after CompilerStack.reset()
2017-06-01 13:44:08 +01:00
Alex Beregszaszi
c212d7c2e6
Remove unused functions from CompilerStack
2017-06-01 13:28:05 +01:00
Rhett Aultman
89b60ffbd4
Refactor error reporting
...
This commit introduces ErrorReporter, a utility class which consolidates
all of the error logging functionality into a common set of functions.
It also replaces all direct interactions with an ErrorList with calls to
an ErrorReporter.
This commit resolves issue #2209
2017-05-30 07:28:31 -07:00
chriseth
40d5d5a956
Also change error message.
2017-05-26 11:13:32 +02:00
Alex Beregszaszi
8c3ec16132
Scanner requires only the SourcesSet state
2017-05-24 22:45:10 +01:00
Alex Beregszaszi
cd5d93da2a
Rename CompilerStack.metadata to CompilerStack.natspec
2017-05-19 16:11:04 +01:00
Alex Beregszaszi
81877cc594
Rename InterfaceHandler to Natspec
2017-05-19 16:11:04 +01:00
Alex Beregszaszi
12328b7848
Split ABI out of InterfaceHandler
2017-05-19 16:11:03 +01:00
Alex Beregszaszi
4bf3cbb09a
Use CompilerStack.contractABI directly
2017-05-19 15:57:36 +01:00
Alex Beregszaszi
8169e149c9
Rename CompilerStack.interface to CompilerStack.contractABI
2017-05-19 15:57:36 +01:00
Alex Beregszaszi
c0f31e4c1b
Ensure proper checks are in CompilerStack
2017-05-11 08:02:03 +01:00
Alex Beregszaszi
5b4b620d8b
Do not crash on AST if parsing failed
2017-05-11 08:02:03 +01:00
djuju
e9954eb325
conditional reset of compilerState-Enum
2017-04-28 18:46:27 +02:00
chriseth
f33614e1f7
Merge pull request #2171 from ethereum/splitParseAndAnalyze
...
refactoring parse() into two separate functions
2017-04-28 17:19:31 +02:00
djuju
a6306a1d44
error fixed
2017-04-28 16:20:32 +02:00
djuju
45f8c5aa88
enumchecks not working
2017-04-28 15:24:59 +02:00
Alex Beregszaszi
b0485e327b
Make assembler errors fatal
2017-04-27 16:34:57 +01:00
Alex Beregszaszi
16276ab10b
Catch assembler exceptions and throw readable Solidity exceptions
2017-04-27 16:06:49 +01:00
djuju
5fd7942173
documentation, checks and renaming
2017-04-27 12:56:56 +02:00
djuju
99a7aefb75
refactoring parse() into two separate functions
2017-04-27 12:38:24 +02:00
Alex Beregszaszi
bf074f3f41
Fix source index allocation in CompilerStack. Depending on compiler(optimisations) this could be off-by-one.
2017-04-20 19:20:14 +01:00
Alex Beregszaszi
54dcb0e11b
Keep gas values as a string in CompilerStack::gasEstimate
2017-04-13 02:18:29 +01:00
Alex Beregszaszi
3fbb48bd46
Exclude fallback function from the internal functions in estimateGas
2017-04-13 02:17:40 +01:00
Alex Beregszaszi
e6221108b6
Move gasEstimate into CompilerStack
2017-04-13 02:17:37 +01:00
Alex Beregszaszi
623b8eb107
Pull out ReadFile from CompilerStack
2017-04-10 12:49:47 +01:00
Alex Beregszaszi
e0ff70778a
Rename ErrorMesage to ErrorMessage
2017-03-16 23:59:36 +00:00
Yoichi Hirai
e364909e06
Merge pull request #1747 from ethereum/fixICEInternalConstructor
...
Move privateness of constructor into AST itself.
2017-03-08 17:49:14 +01:00
chriseth
5c5d83fd70
Check for circular references in constant variables.
2017-03-06 15:05:09 +01:00
chriseth
f300bdb020
Move public constructor property into AST itself.
2017-03-06 14:12:42 +01:00
chriseth
e67faa9839
Extract scopes into compiler stack.
2017-02-14 13:23:44 +01:00
Alex Beregszaszi
fcf483ee6b
Add option to store literal sources in metadata
2017-01-26 13:16:26 +00:00
chriseth
0ef460461a
Check if constructor is public or not.
2017-01-20 19:22:39 +01:00
chriseth
7159944f0f
Reset AST node IDs between compilation runs.
2017-01-20 12:00:16 +01:00
chriseth
005e190885
Merge pull request #1397 from roadriverrail/contract_collision
...
Error out when contracts collide on name
2017-01-18 14:28:00 +01:00
Alex Beregszaszi
350c7e7e2c
Store strict version number in metadata (exclude the platform)
2017-01-17 12:54:58 +00:00
Rhett Aultman
94b092d87c
Provide fall-back method for contract lookup
...
Properly, contracts are now looked up via <source>:<contract> identifiers
called "fully qualified names." As a modicum of backward-compatibility,
failure on a lookup is now backed up by seeing if the ":" exists at all,
and if it doesn't, then the known contracts are scanned for any matching
contract name.
2017-01-16 23:47:04 -05:00
Rhett Aultman
5a2331a9f6
Remove checkLibraryNameClashes()
...
The library name clash checker throws errors when two libraries of the
same name are spotted. In a previous commit, this function was
rewritten to use fully-qualified names instead, which makes it redundant
to the checker for multiply-declared identifiers. Since it no longer
serves a clear purpose, the function is being dropped.
2017-01-16 12:32:58 -05:00
Rhett Aultman
85c55c796a
Remove unique error for contract collision
...
Because contracts are uniquely identified by their source unit, there
is no need for a unique error for this; it's actually covered by the
checker for double-declaration of identifiers.
2017-01-16 12:32:57 -05:00
Rhett Aultman
0c98e4b2da
Stylistic corrections
2017-01-16 12:32:57 -05:00
Rhett Aultman
e3b0827721
Push the error instead of throwing it
...
Throwing a CompilerError on multiple contract definition violates the
expectations of the test suite, which thinks that compile() will
return false if the code can't compile. This brings contract
collision reporting in line with most of the other errors.
2017-01-16 12:32:57 -05:00
Rhett Aultman
071b936b37
Only avoid collision if it's the same file
...
@chriseth had suggested that it would be better if contracts were
referenced in a file:contract notation, and that we output .bin files
that prepend original path names if necessary to avoid a collision.
This commit is mostly a draft; it still needs to be run through the test
suite.
2017-01-16 12:32:57 -05:00
Rhett Aultman
9e88f1eebe
Tab whitespace cleanup (again)
2017-01-16 12:32:57 -05:00
Rhett Aultman
ce3082dec2
Tidy up the error message
2017-01-16 12:32:57 -05:00
Rhett Aultman
b24ca4fa23
Fix tab, drop stupid '!!!', change error message.
2017-01-16 12:32:57 -05:00
Rhett Aultman
f3a84eab91
Error out when contracts collide on name
...
The previous behaviour, courtesy of the [] operator in std::map, would
uncritically store a new ContractDefinition in m_contracts even when a
ContractDefinition already existed. This "resolved" collissions on contract
names by clobbering the original one with the new one, and could lead to
scenarios where the clobber would only be discovered when the original
ContractDefinition could not be found or referred to, which was an unhelpful
InternalCompilerError.
This change checks the m_contracts map for a collision first and will not let
the ContractDefinition be changed to a new one once it's set, throwing a
CompilerError with information about the conflict.
2017-01-16 12:32:57 -05:00
VoR0220
b6508ca992
fixed
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 12:03:54 -06:00
VoR0220
4542f459f1
added fix and a test for order independence of nested prefixing
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 11:45:14 -06:00
VoR0220
4585bfdce7
cleanup
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
fixup
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 11:03:02 -06:00
VoR0220
e02270bbb4
fixed unused filepath bug
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 09:03:41 -06:00
VoR0220
8ace851831
much smaller helper function
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-10 07:17:11 -06:00
VoR0220
79dbd40096
can do this purely on length. Also made prefix filesystem string for more accurate readings.
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-08 22:53:57 -06:00
VoR0220
6d9020b3b8
fixed test and added solution
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-08 22:53:54 -06:00
Yoichi Hirai
41fe412389
interface: change absolutePath() so that ".dir" is considered as an absolute path
...
fixes #1534
2017-01-03 18:18:22 +01:00
chriseth
56a027bedc
Use multiple URLs for metadata.
2016-12-13 16:37:48 +01:00
chriseth
c111d6e27e
Merge pull request #1491 from ameten/refactoring
...
Just refactored some code
2016-12-12 21:43:04 +01:00
Federico Bond
05139500fb
Warn about using msg.value in non-payable function
2016-12-08 16:22:13 -03:00
Danil Nemirovsky
db42294a20
- fixed a misprint.
2016-12-08 21:33:09 +03:00
chriseth
f1907bbb12
Add the _runs
parameter.
2016-12-01 16:04:00 +01:00
chriseth
6a7ff039df
Use CBOR encoding.
2016-12-01 16:03:59 +01:00
chriseth
91ecc4533d
Add swarm hash to the end of the bytecode.
2016-12-01 16:03:59 +01:00
chriseth
659b635b2d
Make sure some keys are present.
2016-12-01 16:03:59 +01:00
chriseth
e666f8cda7
Incorporate comments.
2016-12-01 16:03:59 +01:00
chriseth
5789eaa78d
Metadata stamp.
2016-12-01 16:03:59 +01:00
VoR0220
3f9f725737
Fix licensing headers
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00
chriseth
ec31d08775
Change encoding to address-funid and add "function" as ABI type.
2016-11-16 14:37:19 +01:00
chriseth
e543bd34c0
Stored combined creation and runtime tags.
...
Includes a change to Assembly to allow tags from sub-assemblies to be
used.
Sorry, this get a bit bigger than I thought.
2016-11-16 14:37:18 +01:00
Alex Beregszaszi
9719cf38e6
Move InterfaceHandler from string to JSON
2016-11-15 15:55:25 +00:00
chriseth
762f7ac250
Suggest correct version for pragma and complain about pre-release version.
2016-10-25 13:45:50 +02:00
Alex Beregszaszi
aefb6e5fcf
Rename dev::sha3 to dev::keccak256
2016-10-06 14:53:40 +01:00
Dimitry
061aee2e97
fix CompilerStack::absolutePath
2016-08-31 22:10:20 +03:00
Denton Liu
e00f802f72
Remove standard contracts
2016-08-19 10:34:50 -04:00
Dimitry
e5e2597702
remove solidity --interface
2016-08-17 12:39:10 +03:00
chriseth
c55584d3e2
Source location as part of AST.
2016-07-20 19:45:43 +02:00
chriseth
9a9a815fc9
Provide formal version in json output.
2016-07-18 18:26:56 +02:00
chriseth
3150ab2bcf
Allow remappings to change depending on the context.
2016-06-08 18:16:46 +02:00
chriseth
67c855c583
Merge pull request #356 from guanqun/break-not-in-loop
...
check whether break/continue is in the loop
2016-01-20 19:23:23 +01:00