Alex Beregszaszi
767ec1d670
Support explicit conversion of external function type to address
2017-02-01 12:23:47 +00:00
chriseth
a9c6ff4ac8
Refactor json return type generation.
2017-01-26 18:21:19 +01:00
chriseth
3949624a61
Also check library addresses.
2017-01-24 23:37:48 +01:00
chriseth
1316bb7565
Warn about invalid checksums of addresses.
2017-01-24 23:37:48 +01:00
chriseth
0ef460461a
Check if constructor is public or not.
2017-01-20 19:22:39 +01:00
Yoichi Hirai
12b002b3b8
Merge pull request #1576 from ethereum/typeIdentifiers
...
Type identifiers.
2017-01-20 16:18:57 +01:00
chriseth
07b0a0a560
Make m_id const.
2017-01-20 15:56:56 +01:00
chriseth
7159944f0f
Reset AST node IDs between compilation runs.
2017-01-20 12:00:16 +01:00
chriseth
da178d967f
Properly escape user strings and lists.
2017-01-19 13:23:58 +01:00
chriseth
3fed790a56
Type identifiers.
2017-01-19 13:23:57 +01:00
chriseth
23a654ade8
Fix default function type name visibility.
2017-01-19 11:11:40 +01:00
Federico Bond
d40ae663ec
Fix typo in comment
2017-01-18 12:43:23 -03:00
chriseth
28a05e5aa3
Merge pull request #1581 from ethereum/fixosx
...
Fix JSON output on macos.
2017-01-18 15:41:39 +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
chriseth
c16e141ffb
Fix JSON output on macos.
2017-01-18 14:09:40 +01:00
chriseth
99eaadd2cd
Deterministic AST node identifiers.
2017-01-17 10:45:45 +01:00
Rhett Aultman
f10bf36ae3
Move fullyQualified() name to Declaration
2017-01-16 12:32:57 -05:00
Rhett Aultman
0c98e4b2da
Stylistic corrections
2017-01-16 12:32:57 -05:00
Rhett Aultman
8f25bd54e3
Drop ':' if the source file name is empty
...
A large number of tests compile contracts while passing in an empty
string for the source name. This leads to it being keyed by the name
":<contract>", while the tests try to look it up under the name
"<contract>". This change resolves that issue by dropping the ':' in
cases where there is, effectively, no source file to prepend anyway.
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
Yoichi Hirai
abc24420a7
ast: events have FunctionType too
2017-01-11 20:06:59 +01:00
Yoichi Hirai
eda147f47b
ast: add Declaration::functionType()
2017-01-11 19:55:50 +01:00
Yoichi Hirai
6a312233fc
ast, codegen: enable accessing events through contract names.
...
Fixes #1286
2017-01-02 17:59:20 +01:00
Yoichi Hirai
f8fe6e4f7c
Merge pull request #1503 from federicobond/json-visibility
...
Include visibility level for functions in AST
2016-12-14 17:23:14 +01:00
Yoichi Hirai
18f8f29c0a
Merge pull request #1487 from ethereum/shift-ops
...
Shift operators
2016-12-14 16:31:27 +01:00
Federico Bond
de720e643d
Improve error message when trying to modify constant variables
2016-12-13 00:32:37 -03:00
Federico Bond
9ed65f2ab9
Include visibility level for functions in AST
2016-12-12 16:21:57 -03:00
chriseth
2738045030
Cleaner shift handling and type conversion for binary operations.
2016-12-12 11:12:12 +01:00
chriseth
2df60bec92
Type after shift should be type of left operand.
2016-12-12 11:12:12 +01:00
Alex Beregszaszi
b8b4f5e9f9
Support bitshifting in variables
2016-12-12 11:12:10 +01:00
chriseth
d2b8bdd016
Merge pull request #1464 from federicobond/warn-msgvalue
...
Warn about using msg.value in non-payable function
2016-12-11 16:46:06 +01:00
Federico Bond
df76230240
Fix names of JSON AST nodes
2016-12-11 02:07:08 -03:00
Federico Bond
05139500fb
Warn about using msg.value in non-payable function
2016-12-08 16:22:13 -03:00
chriseth
91ecc4533d
Add swarm hash to the end of the bytecode.
2016-12-01 16:03:59 +01:00
chriseth
5789eaa78d
Metadata stamp.
2016-12-01 16:03:59 +01:00
Alex Beregszaszi
a9e92cb686
Rename dev::validate to dev::validateUTF8
2016-11-28 22:28:21 +00:00
Alex Beregszaszi
c01426efec
Make position optional in dev::validate
2016-11-28 22:27:55 +00:00
chriseth
da566b956e
Indentation.
2016-11-25 14:36:44 +01:00
Yoichi Hirai
e136ec8704
ast: string literals that are not valid UTF are not convertible to strings
2016-11-25 13:36:06 +01:00
VoR0220
3f9f725737
Fix licensing headers
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00
chriseth
2c14a96820
Some more assertions and style changes.
2016-11-16 15:09:01 +01:00
chriseth
ec31d08775
Change encoding to address-funid and add "function" as ABI type.
2016-11-16 14:37:19 +01:00
chriseth
22b4d1b29a
Check that no internals are used in any external function type.
2016-11-16 14:37:18 +01:00
chriseth
925d674146
Disallow payable internal functions.
2016-11-16 14:37:18 +01:00
chriseth
f21f794f3c
delete for function types
2016-11-16 14:37:18 +01:00
chriseth
ff3553a348
Change alignment.
2016-11-16 14:37:18 +01:00
chriseth
62492b67e7
Changelog entry and small fixes.
2016-11-16 14:37:18 +01:00
chriseth
6f19559de0
Fix some type checks and tests for internal / external function parameters.
2016-11-16 14:37:17 +01:00
chriseth
dd173f83e3
Code generator for function types.
2016-11-16 14:37:17 +01:00
chriseth
cc8583ec7d
Function types.
2016-11-16 14:37:17 +01:00
Alex Beregszaszi
9719cf38e6
Move InterfaceHandler from string to JSON
2016-11-15 15:55:25 +00:00
Alex Sinyagin
6db9fd498a
Print canonical names of structs and enums in AST
2016-11-14 13:39:46 +00:00
Yoichi Hirai
20c2ca3992
ast, codegen: disallow conversion between different enum types
2016-11-11 17:48:03 +01:00
Yoichi Hirai
e6098f0039
ast: add EnumType::numberOfMembers()
2016-11-11 17:47:48 +01:00
Yoichi Hirai
6c15757618
Type checker: move the burden of computing mobile type to commonType
...
This solves #621
2016-11-11 15:51:54 +01:00
Rhett Aultman
4524ad0870
Add support for do/while loops
...
This commit adds support for a standard do <statement> while <expr>;
form of statement. While loops were already being supported; supporting
a do/while loop mostly involves reusing code from while loops but putting
the conditional checking last.
2016-11-10 07:07:25 -08:00
yann300
02416d4460
add payable to AST
2016-11-03 16:36:38 +01:00
Yoichi Hirai
3ca5900b8c
ast: ban signed EXP, fixing #1246
2016-10-25 16:49:10 +02:00
chriseth
f25aa0c68b
More checks for missing mobile type.
2016-10-24 16:45:25 +02:00
chriseth
2b00804d1d
Fix crash in throw.
2016-10-24 14:32:49 +02:00
chriseth
cb1fcaf6f6
Merge pull request #1240 from ethereum/1151
...
ast: super contract type does not contain native members
2016-10-24 11:45:54 +02:00
Yoichi Hirai
9d9380d30e
ast: add a null check
2016-10-21 13:01:45 +02:00
Yoichi Hirai
83e8fdecc5
ast: ContractDefinition::inheritableMembers contains enums as well as structs
...
This fixes #1131
2016-10-21 13:01:45 +02:00
Alex Beregszaszi
7b0fb5d06b
Support variable references within modifiers for inline assembly
2016-10-20 23:45:13 +01:00
Yoichi Hirai
7887045a48
ast: simplifications suggested by @chriseth
2016-10-20 16:09:52 +02:00
Yoichi Hirai
ff9039b2a8
When a contract type is super, its members do not contain the functions of itself
...
Fixes #1151
2016-10-20 16:09:52 +02:00
Alex Beregszaszi
7ac27c957e
Use >> (SAR) to denote constant shifts
2016-10-20 00:03:09 +01:00
Alex Beregszaszi
33250eef9e
Reject negative shifts within constants
2016-10-20 00:03:09 +01:00
RJ
48f2028911
Support shifting constants
2016-10-20 00:03:09 +01:00
Alex Beregszaszi
fdd1108c1c
Omit non-convertible bound functions
2016-10-19 10:41:04 +01:00
Alex Beregszaszi
003359a0b6
Ensure that bound functions cannot be defined without self type
2016-10-19 10:41:04 +01:00
Yoichi Hirai
d2470a3e39
super
's size on stack is zero, because the expression compiler does not push an address.
...
This is different from `this`, which is translated to `ADDRESS` instruction.
2016-10-18 14:17:49 +02:00
Yoichi Hirai
8e11bac8de
Check if a fixedBytes fits an integer type
...
before looking up the size of the integer type.
Fixes #1150 .
2016-10-13 20:17:13 +02:00
Alex Beregszaszi
aefb6e5fcf
Rename dev::sha3 to dev::keccak256
2016-10-06 14:53:40 +01:00
Alex Beregszaszi
2d9c407456
Include assert for selfType on bound functions to avoid crash
2016-09-06 22:10:51 +01:00
chriseth
f687635e47
Merge pull request #665 from axic/feature/accept-ether
...
BREAKING: Add payable modifier
2016-09-06 12:25:19 +02:00
chriseth
9c64edf110
Change function type to include and propagate payable and constant modifier.
2016-09-05 21:28:28 +02:00
Alex Beregszaszi
962531af96
Merged in changes from chriseth/payable
2016-09-05 21:28:28 +02:00
Alex Beregszaszi
a34f2f1a31
Support payable keyword for functions
2016-09-05 21:28:18 +02:00
chriseth
ada31fa9b7
Do not emit non-utf8 strings for ast json.
2016-09-02 00:22:03 +02:00
chriseth
3c412ed2f6
Version pragma.
2016-09-01 00:02:51 +02:00
chriseth
35276d99e0
JSON AST: Some attribute cleanup. Add linearized base contracts.
2016-08-19 13:05:12 +02:00
Alex Sinyagin
4b9eb299d0
Rename root AST JSON node to SourceUnit
2016-08-18 15:38:20 +00:00
Alex Sinyagin
4387d8bbe3
Do not add children to EnumValue and PlaceholderStatement elements in JSON AST
2016-08-18 13:29:44 +00:00
Alex Sinyagin
9139d763d3
Use the full names for JSON AST nodes
2016-08-18 13:12:15 +00:00
Alex Sinyagin
5061eb2b2b
Move creation of the root element of JSON AST to the SourceUnit visitor
2016-08-18 12:51:17 +00:00
Alex Sinyagin
406f3a4b5d
Add ast json converter for PlaceholderStatement
2016-08-18 12:30:00 +00:00
Alex Sinyagin
e9c894c9f8
Add ast json converter for ArrayTypeName
2016-08-18 12:30:00 +00:00
Alex Sinyagin
bdc2436ae3
Add ast json converter for ModifierInvocation and EventDefinition
2016-08-18 12:30:00 +00:00
Alex Sinyagin
a5d15e6895
Add ast json converter for ModifierDefinition
2016-08-18 12:29:59 +00:00
Alex Sinyagin
95832da16e
Add ast json converter for EnumValue
2016-08-18 12:29:59 +00:00
Alex Sinyagin
a9e04217a4
Add ast json converter for EnumDefinition
2016-08-18 12:29:59 +00:00
Alex Sinyagin
40ca2c9e97
Add ast json converter for UsingForDirective
2016-08-18 12:29:59 +00:00
Alex Sinyagin
9e7fc12463
Add a ast json converter for InheritanceSpecifier
2016-08-18 12:29:59 +00:00
chriseth
0d894a6832
Merge pull request #844 from Denton-L/remove-after
...
BREAKING: Remove after
2016-08-12 15:09:55 +02:00
Alex Sinyagin
cbedc7b343
Fix Mapping and InlineAssembly in JSON AST
2016-08-11 17:00:19 +00:00
Alex Sinyagin
a7ff352d38
Fix JSON AST structure
2016-08-11 17:00:19 +00:00
Denton Liu
faf0b3f669
Remove After from Types.cpp
2016-08-11 10:15:59 -04:00
chriseth
55858de1e9
Merge pull request #794 from chriseth/fixastsource
...
Fix segfault in ast output.
2016-08-10 16:58:17 +02:00
Alex Beregszaszi
5d9347f022
Remove dev::utf8 namespace
2016-08-08 20:05:31 +01:00