Commit Graph
179 Commits
Author SHA1 Message Date
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
Alex Beregszaszi f869792eec Fix type of optimizeRuns 2016-12-01 16:03:59 +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
Alex Beregszaszi 60e9c901e9 Include payable for the constructor in the ABI 2016-11-17 17:23:35 +00: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
chriseth 746266b8fc ABI: Use external function. 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
Alex Beregszaszi ac46834d7d Do not include a trailing new line in the ABI JSON output 2016-11-15 02:20:38 +00:00
Rhett Aultman 58e75c7a48 Unimplemented features moved to their own exception (#1361)
Unimplemented features moved to their own exception

InternalCompilerError is an exception that really should be reserved for
actual internal errors of the compiler.  Unimplemented features can now
use either solUnimplemented( ) or, if it should be conditional, then
solUnimplementedAssert( ).

* Revert some unimplemented exceptions, add handlers

The jsonCompiler and CommandLineInterface needed handlers for the
new UnimplementedFeatureException, and some cases I had moved on to
the new exception were better treated as real internal compiler
errors.

* Standardize on "Unimplemented feature" message
2016-11-14 20:41:58 +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
chriseth 6a55405160 Fix problem with release version string. 2016-09-08 17:56:28 +02:00
Alex Beregszaszi 6ec40b3cde Reject constant modifier on the fallback function 2016-09-06 11:40:00 +01:00
chriseth dff9633084 Test and fixes for payable fallback in ABI. 2016-09-06 10:59:13 +02:00
Alex Beregszaszi 75d556a2cf Do not include the payable keyword for constructors 2016-09-05 21:28:18 +02:00
Alex Beregszaszi a34f2f1a31 Support payable keyword for functions 2016-09-05 21:28:18 +02:00
chriseth 24ffc38575 Do not use internal types for event parameters. 2016-09-02 00:39:30 +02:00
Dimitry 061aee2e97 fix CompilerStack::absolutePath 2016-08-31 22:10:20 +03:00
chriseth cf974fd103 Merge pull request #664 from axic/feature/interface-fallback
Introduce fallback entry in the ABI
2016-08-30 15:21:19 +02:00
Bob Summerwill 91d4fa477c Merge pull request #941 from chriseth/versionString
Version string
2016-08-26 22:58:32 -07:00
Alex Beregszaszi 36a567cd61 Introduce fallback entry in the ABI 2016-08-26 19:03:46 +01:00
chriseth 54ab787b83 Make versioning semver compatible and force commit hash availability. 2016-08-26 10:14:44 +02: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