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

Update to master #6

Merged
merged 246 commits into from
Dec 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
f59f9f6
Added get_logs method to return a list of logs with optional filterin…
fubuloubu Oct 18, 2017
543d6f4
WIP overhaul of types
Oct 23, 2017
e436f14
Draft of viper-by-example.
Oct 19, 2017
484da3b
fixes voting with delegation example
DustinWehr Oct 26, 2017
21cc53a
use falsey-ness of 0x0000000000000000000000000000000000000000
DustinWehr Oct 26, 2017
205c622
use falsey-ness of 0x0000000000000000000000000000000000000000 (revert…
DustinWehr Oct 26, 2017
7bc3e9a
use falsey-ness of 0x0000000000000000000000000000000000000000
DustinWehr Oct 26, 2017
d904b9d
iff --> if and only if
DustinWehr Oct 26, 2017
e578258
Adds basic for loop for in memory list.
jacqueswww Oct 30, 2017
706ec2e
Adds test for literal list.
jacqueswww Oct 30, 2017
f51d04d
Adds for i in list support from storage and list literals.
jacqueswww Oct 31, 2017
47b44d3
Adds support for i in list of other BaseTypes.
jacqueswww Oct 31, 2017
e32f3cc
Add StructureException testcase for iterating over a nested list.
jacqueswww Oct 31, 2017
746bcd7
Allow skip of the event name
fubuloubu Oct 31, 2017
fbaea21
Change function to func
DavidKnott Oct 31, 2017
68725f4
Changed get_log() to get_last_log(), removed optional log name from u…
fubuloubu Oct 31, 2017
618f36e
Merge pull request #441 from DavidKnott/rename-shadow-built-name
DavidKnott Oct 31, 2017
452b4c8
Make corrections according to suggestions.
Nov 1, 2017
2aeb9cf
Minor typo.
Nov 1, 2017
7ddfa93
Adds basic bytes as map keys support.
jacqueswww Nov 1, 2017
f207528
Adds support for mapping literal bytes.
jacqueswww Nov 1, 2017
d879533
fix the problems when install viper in Ubuntu16.04
Nov 2, 2017
a9adb07
Adds test for long than 32 bytes keys.
jacqueswww Nov 2, 2017
f46762d
Adds test for mismatched bytes size map assign.
jacqueswww Nov 2, 2017
be71ed0
Adds variable name to i_pos, so it doesn't conflict.
jacqueswww Nov 3, 2017
a729570
Adds exceptions for altering lists whilst iterating them.
jacqueswww Nov 3, 2017
e092ca0
Fixe for altering list in iteration exception check.
jacqueswww Nov 3, 2017
f9b3b75
Merge pull request #442 from kaikai1024/master
DavidKnott Nov 5, 2017
ead7538
Adds tests for assert x in list
jacqueswww Nov 6, 2017
430eaa0
Added reference types.
Nov 6, 2017
38a8e4f
Merge pull request #418 from NedYork/master
DavidKnott Nov 7, 2017
738eabb
Add the packaging metadata to build the viper snap
Nov 7, 2017
50726b7
Merge pull request #440 from jacqueswww/438_for_i_in_list
DavidKnott Nov 7, 2017
b1fe12d
Merge pull request #408 from fubuloubu/logs_fixture
DavidKnott Nov 7, 2017
15c5ea8
Improves ownership test - to be more realistic.
jacqueswww Nov 7, 2017
7a92cd9
Modified assert_tx_failed() to remove reference to tester as tester r…
fubuloubu Nov 7, 2017
c3d141e
Add 65 and 25 gas to CLAMP and ASSERT pseudo opcodes, based on test_d…
jacqueswww Nov 9, 2017
7be701f
Various changes to gas estimation.
jacqueswww Nov 9, 2017
f0afae0
Replace get_contract with get_contract_with_gas_estimation.
jacqueswww Nov 9, 2017
ea09106
Adds test for keys with a very long byte length.
jacqueswww Nov 9, 2017
f6f6eb1
Removed compound calling, small touchups
Nov 9, 2017
85e3898
Minor spelling fix
Nov 10, 2017
a61bb77
Merge pull request #458 from neilh/patch-1
DavidKnott Nov 11, 2017
b014a4b
Remove empty test
DavidKnott Oct 23, 2017
6bd257e
Refactor code parsing
DavidKnott Oct 29, 2017
2597c18
Fix typo in folder name
DavidKnott Oct 29, 2017
8b24f63
Merge pull request #437 from DavidKnott/refactor-parser
DavidKnott Nov 11, 2017
2a111b2
Merge pull request #431 from DustinWehr/master
DavidKnott Nov 11, 2017
d8f61c7
Merge pull request #446 from fubuloubu/remove_tester_ref
DavidKnott Nov 12, 2017
ef62cc5
Make pseudo opcode gas estimate a single value.
jacqueswww Nov 13, 2017
8468c4c
Add test for colored gas estimate output when using -f ir.
jacqueswww Nov 13, 2017
679e651
Merge branch 'master' into one-more-in-test
jacqueswww Nov 13, 2017
efe6c4c
Remove tester from assert_tx_failed.
jacqueswww Nov 13, 2017
a1ea7ee
Merge pull request #427 from chgue/docs-3-types
DavidKnott Nov 13, 2017
352ca45
Merge pull request #447 from jacqueswww/fix-some-estimates
DavidKnott Nov 13, 2017
557acfb
Move test_company file into proper folder
DavidKnott Nov 13, 2017
57f20e6
Merge pull request #464 from DavidKnott/fix-company-example
DavidKnott Nov 13, 2017
d189d41
Fix constant clamp checks / change constant clamp checks to compile time
DavidKnott Nov 11, 2017
5f7ee75
Add fixture to directly test LLL
DavidKnott Nov 11, 2017
997c3ea
Add clamp tests at the LLL level
DavidKnott Nov 11, 2017
17a153c
Merge pull request #460 from DavidKnott/fix-clamps
DavidKnott Nov 13, 2017
c744052
Break out `test_parser.py` into test specific files
DavidKnott Nov 14, 2017
e3e6019
Change to assert_tx_failed
DavidKnott Nov 14, 2017
d805678
Add staticcall opcode for constant function calls
DavidKnott Oct 13, 2017
cbf70ed
Test constant external function calls
DavidKnott Nov 12, 2017
5ffdef8
Remove repetitive assert_tx_failed
DavidKnott Nov 12, 2017
f1297d3
Merge pull request #466 from DavidKnott/refactor-tests
DavidKnott Nov 14, 2017
ff45b3f
Create Viper VIP template
DavidKnott Nov 14, 2017
bcb3527
Add link to VIP template to the issue template
DavidKnott Nov 14, 2017
95fb0e7
Improve rlp decoding gas estimation
DavidKnott Nov 13, 2017
132d337
Add VIP link to contributing docs
DavidKnott Nov 14, 2017
36e926d
Merge pull request #465 from DavidKnott/fix-rlp-gas-estimation
DavidKnott Nov 14, 2017
14ed6cd
Merge pull request #467 from DavidKnott/create-vip-template
DavidKnott Nov 14, 2017
974c62e
Merge pull request #402 from DavidKnott/re-entrancy-protection
DavidKnott Nov 14, 2017
abc8651
fix issue #453
daejunpark Nov 10, 2017
5d15208
use clamp constants for literals as well
daejunpark Nov 10, 2017
dff5ceb
fix num_min_literal parsing failure
daejunpark Nov 10, 2017
52a040f
fix test coverage
daejunpark Nov 15, 2017
1e0254d
fix issue #448: compile_lll.py: buggy translation of LLL operator `sh…
daejunpark Nov 9, 2017
48301a3
add sha3_32 compilation test
daejunpark Nov 15, 2017
0b9062b
Merge pull request #457 from daejunpark/fix-issue-453
DavidKnott Nov 15, 2017
53a8d71
Merge branch 'master' into one-more-in-test
jacqueswww Nov 15, 2017
b905905
Add checks preventing assigning values on defining types.
jacqueswww Nov 15, 2017
65845c6
Merge pull request #470 from jacqueswww/410_invalid_annotate_assign
DavidKnott Nov 15, 2017
eeac89d
Fix gas estimation error
DavidKnott Nov 16, 2017
42bca94
Fix repeat LLL with <= 0 iteration
DavidKnott Nov 11, 2017
4064430
Add test for repat lll
DavidKnott Nov 16, 2017
0cbbf7a
Merge pull request #461 from DavidKnott/fix-for-loop
DavidKnott Nov 16, 2017
5bbfd13
Merge pull request #452 from daejunpark/master
DavidKnott Nov 16, 2017
67dd476
Add depth check to with "set" statement
DavidKnott Nov 11, 2017
3600634
Merge pull request #462 from DavidKnott/fix-invalid-case-check
DavidKnott Nov 16, 2017
503f72e
Require function visibility declaration
DavidKnott Nov 11, 2017
4601445
Add tests for public decorator
DavidKnott Nov 14, 2017
1cac823
Merge pull request #444 from jacqueswww/one-more-in-test
DavidKnott Nov 16, 2017
3a16e9e
Merge pull request #468 from DavidKnott/require-function-visibility
DavidKnott Nov 16, 2017
35a915b
Add public decorator to tests (#474)
DavidKnott Nov 16, 2017
67963b5
Merge pull request #473 from DavidKnott/fix-gas-estimation-error
DavidKnott Nov 16, 2017
494bd81
Document function visibility requirements
jessebmiller Nov 20, 2017
9dcacc0
Merge pull request #1 from jessebmiller/jessebmiller-visibility-doc
jessebmiller Nov 20, 2017
358e30d
Clarifies expectation in error message
jessebmiller Nov 20, 2017
3d7c249
Note internal or public decorator requirement
jessebmiller Nov 20, 2017
d8542d3
Merge pull request #486 from jessebmiller/master
DavidKnott Nov 21, 2017
89eefcb
Merge branch 'master' into bytes-as-mapping-keys
jacqueswww Nov 22, 2017
4a31cba
Fixes test with for function visibility.
jacqueswww Nov 22, 2017
1ac0824
Add the install instructions for the Viper snap
Nov 22, 2017
15601b6
Merge pull request #443 from jacqueswww/bytes-as-mapping-keys
DavidKnott Nov 22, 2017
675acea
Merge pull request #445 from elopio/snapcraft
DavidKnott Nov 22, 2017
e9ad274
Allow for gas estimation tests for constants
DavidKnott Nov 16, 2017
905c63f
Add gas estimation for create_with_code_of
DavidKnott Nov 17, 2017
9653881
Merge pull request #480 from DavidKnott/improve-gas-estimation
DavidKnott Nov 22, 2017
55079d9
Merge pull request #490 from elopio/patch-1
DavidKnott Nov 22, 2017
1574b2f
ad logs to company.v.py with tests
jessebmiller Nov 23, 2017
42d224b
document event in structure of a contract
jessebmiller Nov 23, 2017
55aed45
move events before global declarations
jessebmiller Nov 23, 2017
ba497c8
remove unused import
jessebmiller Nov 23, 2017
3652767
types.py: Remove duplicated method
Nov 23, 2017
4c2f0bf
Adds support -f bytecode_runtime.
jacqueswww Nov 23, 2017
098f425
cleans up test_logs
jessebmiller Nov 23, 2017
196be6d
Merge pull request #496 from adhikasp/duplicate-ceil32
DavidKnott Nov 23, 2017
30fdc6a
Merge pull request #494 from jessebmiller/log_doc
DavidKnott Nov 23, 2017
4000244
Use revert opcode for assert statements
DavidKnott Nov 22, 2017
f24499a
Show lineno of base_type_conversion error
Nov 23, 2017
0b691a5
Show lineno of undeclared function visibility
Nov 23, 2017
c07bc16
Adds basic test for bytecode_runtime generation.
jacqueswww Nov 24, 2017
4ff6b7a
Merge pull request #497 from jacqueswww/bytecode_runtime_output
DavidKnott Nov 24, 2017
ae01c4b
add clamp_nonzero to modulo arithemetic
DavidKnott Nov 24, 2017
1cfccc0
Add modulo tests and refactor simple auction example
DavidKnott Nov 24, 2017
149a1a6
Merge pull request #492 from DavidKnott/add-revert-opcode
DavidKnott Nov 24, 2017
3ebe694
Use `with` to decrease repetition
DavidKnott Nov 22, 2017
f4fca63
Merge pull request #502 from DavidKnott/fix-modulo
DavidKnott Nov 25, 2017
8e96d12
Change vipercoin from returning false to throwing
DavidKnott Nov 25, 2017
5d0158d
Merge pull request #507 from DavidKnott/fix-vipercoin
DavidKnott Nov 26, 2017
827c7c5
Add check to as_num256 to make sure number is greater than 0
DavidKnott Nov 25, 2017
82bc514
Improve contributing .rst
sdtsui Nov 26, 2017
4d0f2de
Merge pull request #511 from sdtsui/patch-1
DavidKnott Nov 26, 2017
7f6e52f
Added testing and deployment doc
fubuloubu Nov 26, 2017
b4e0f2c
Merge pull request #514 from fubuloubu/patch-1
DavidKnott Nov 27, 2017
2dcf9e0
Fix augassignment checks
DavidKnott Nov 26, 2017
60c0e2f
Test for in list invalids
DavidKnott Nov 26, 2017
928be78
Remove repetitive error and fix typo
DavidKnott Nov 27, 2017
07b4e7a
Merge pull request #503 from DavidKnott/decrease-gas-costs
DavidKnott Nov 27, 2017
946e278
Merge pull request #506 from DavidKnott/fix-as-num256
DavidKnott Nov 27, 2017
9ac49eb
Begin adding built in erc20 external call functionality
DavidKnott Oct 10, 2017
369b495
Add implied erc20 token abi fucntionality
DavidKnott Oct 11, 2017
30de77c
Add on chain market maker example
DavidKnott Oct 11, 2017
f0cb7ca
Test implied erc20 abi functionality
DavidKnott Oct 26, 2017
1394fa3
Update on chain market maker and erc20 abi
DavidKnott Nov 25, 2017
5dbe4fc
Merge pull request #433 from DavidKnott/add-erc20-abi-functionality
DavidKnott Nov 27, 2017
4a30cdf
Merge pull request #513 from DavidKnott/fix-in-loop
DavidKnott Nov 28, 2017
5464db6
Merge pull request #499 from adhikasp/show-lineno
DavidKnott Nov 29, 2017
5d9c65a
Change @internal decorator to @private decorator.
jacqueswww Nov 29, 2017
f947b7b
Add support for logging a variable of list type.
jacqueswww Nov 30, 2017
21ebf91
Adds tests for logging of list types.
jacqueswww Nov 30, 2017
c9d6d35
Fix for log packing on list variable.
jacqueswww Nov 30, 2017
bf6ed1b
Merge pull request #526 from jacqueswww/change_decorator_to_private
DavidKnott Nov 30, 2017
a779a3c
Add error if log has wrong number of arguments
DavidKnott Nov 29, 2017
a0a4358
Add log test and improve bytes as input
DavidKnott Nov 29, 2017
35fb4de
Improve variable naming / fix bytes as input
DavidKnott Nov 30, 2017
a36509a
Clean up tests
DavidKnott Nov 30, 2017
dd9863a
Adds Fix #531. Check return type of lists match.
jacqueswww Dec 1, 2017
729c2eb
Adds more tests for logging of lists.
jacqueswww Dec 1, 2017
10b19ec
Adds Fix #504 for clamping decimal literals correctly.
jacqueswww Dec 1, 2017
8c6000b
Merge pull request #524 from DavidKnott/fix-logging
DavidKnott Dec 1, 2017
8025a6a
Use revert for clamps
DavidKnott Dec 3, 2017
af8f618
Fix exponents with units
DavidKnott Dec 1, 2017
efd5f2d
Create a contract data type
DavidKnott Nov 28, 2017
4abdd2b
Remove .python-version, update .gitignore
lrettig Dec 4, 2017
c3a1e3c
Merge pull request #534 from jacqueswww/504_literal_decimal_clamping
DavidKnott Dec 4, 2017
ad29e08
Merge pull request #538 from DavidKnott/fix-exponents
DavidKnott Dec 4, 2017
c97520a
Merge pull request #540 from lrettig/master
DavidKnott Dec 4, 2017
bd7defc
Merge master.
jacqueswww Dec 4, 2017
830281e
Merge pull request #532 from jacqueswww/521_fix_literal_list_logging
DavidKnott Dec 4, 2017
d2ae6fd
Merge pull request #536 from DavidKnott/use-revert-for-clamps
DavidKnott Dec 4, 2017
0a13493
Improve vipercoin example: link out to resources describing attack ve…
sdtsui Dec 4, 2017
7c303c3
Merge pull request #543 from sdtsui/fix/510
DavidKnott Dec 4, 2017
f477f77
Test the contract data type
DavidKnott Nov 28, 2017
0b11ca5
Merge pull request #533 from jacqueswww/531_list_return_type_fix
DavidKnott Dec 4, 2017
e6d4b18
Merge pull request #537 from DavidKnott/create-contract-data-type
DavidKnott Dec 5, 2017
7336d65
Update version of ethereum
mslipper Dec 5, 2017
b0cec59
Merge pull request #544 from mslipper/update-ethereum
DavidKnott Dec 5, 2017
2e74e11
Improves gas estimate on internal call.
jacqueswww Dec 6, 2017
aeb1fbe
Removed suicide keyword
fubuloubu Dec 6, 2017
ccc53b2
Carry over add_gas_estimate in optimizer.
jacqueswww Dec 7, 2017
4b0fbba
Adds gas estimation for internal calls.
jacqueswww Dec 7, 2017
ae100b8
Merge pull request #550 from jacqueswww/internal-contract-call-estimates
DavidKnott Dec 7, 2017
d658ae7
Added test for invalid keyword
fubuloubu Dec 8, 2017
9b2da7c
not official a language > officially
jamesray1 Dec 8, 2017
0691b1d
Changing notes to be indented blocks starting on the line after .. no…
jamesray1 Dec 8, 2017
699ccfa
Adds storage list logging support.
jacqueswww Dec 8, 2017
96461a9
Adds test to check list logging is of correct (sub)type.
jacqueswww Dec 8, 2017
eabcee4
Splitting comments over two lines where necessary to fit on the page …
jamesray1 Dec 9, 2017
58357e6
Merge pull request #560 from jamesray1/patch-1
DavidKnott Dec 9, 2017
f8fd58b
Merge pull request #549 from fubuloubu/remove_suicide
DavidKnott Dec 9, 2017
d23624b
Update to use conftest; fix some incorrect tests
mslipper Dec 10, 2017
17609e3
Update Safe Remote Purchases: line numbers, minor edits
jamesray1 Dec 10, 2017
82bc0d5
Merge pull request #565 from jamesray1/patch-4
DavidKnott Dec 10, 2017
5609e63
Merge pull request #561 from jamesray1/patch-3
DavidKnott Dec 10, 2017
abecf1e
Updates from code review
mslipper Dec 10, 2017
8828960
Merge pull request #567 from mslipper/use-conftest
DavidKnott Dec 11, 2017
441e41b
Add modulo math checks
DavidKnott Dec 11, 2017
3e2a3ed
Adds support for logging bytes from storage.
jacqueswww Dec 11, 2017
cbd0d01
Adds exception to limit to 32 bytes of bytes type logging (restrictio…
jacqueswww Dec 11, 2017
5e4ba36
Merge branch 'master' into 551_storage_list_logging
jacqueswww Dec 11, 2017
4a45408
virtualenv -p /usr/local/lib/python3.6/bin/python3 > virtualenv -p py…
jamesray1 Dec 11, 2017
472942b
Add a note on how to fix `fatal error: openssl/aes.h: No such file or…
jamesray1 Dec 12, 2017
975fcd7
removed extraneous backtick `
jamesray1 Dec 12, 2017
4c21dc0
Minor edits
jamesray1 Dec 12, 2017
30472cf
Minor edits voting
jamesray1 Dec 12, 2017
7fca338
Merge pull request #580 from jamesray1/patch-9
DavidKnott Dec 13, 2017
fcf3246
Merge pull request #578 from jamesray1/patch-7
DavidKnott Dec 13, 2017
fd527ea
Merge pull request #575 from jamesray1/patch-5
DavidKnott Dec 13, 2017
0768c55
Merge pull request #572 from jamesray1/patch-1
DavidKnott Dec 13, 2017
4390f26
Improve for loop error
DavidKnott Dec 11, 2017
43df433
Adds test for logging a decimal list.
jacqueswww Dec 13, 2017
1a8322c
:ref:`function-calls` > :ref:`Function-calls`
jamesray1 Dec 14, 2017
1ef0475
Minor edits types.rst
jamesray1 Dec 14, 2017
8629327
Merge pull request #587 from jamesray1/patch-7
DavidKnott Dec 14, 2017
9144d6c
Merge pull request #586 from jamesray1/patch-5
DavidKnott Dec 14, 2017
8f12e6c
Merge pull request #571 from jacqueswww/551_storage_list_logging
DavidKnott Dec 14, 2017
af740fa
Merge pull request #568 from DavidKnott/fix-for-loop-error
DavidKnott Dec 14, 2017
8f07053
Add length check to event topics
DavidKnott Dec 7, 2017
83b90f3
Fix and test logging with units
DavidKnott Dec 15, 2017
080e4df
Improve type parsing error message
DavidKnott Dec 15, 2017
d16ea6d
Add valid call keyword list to utils
DavidKnott Dec 15, 2017
43c8ef6
Add length check to event topics
DavidKnott Dec 7, 2017
c5a4a7a
Merge pull request #555 from DavidKnott/add-logging-bytes-check
DavidKnott Dec 15, 2017
c5a3b22
Partial fix for #590. Adds check for a minimum of one return statement.
jacqueswww Dec 19, 2017
447112a
Fixes test that were missing return statements.
jacqueswww Dec 19, 2017
d898f0c
Adds example of return checker behaving incorrectly.
jacqueswww Dec 20, 2017
bee759a
Merge pull request #592 from jacqueswww/590-missing-return-statement
DavidKnott Dec 21, 2017
d9ebaa9
Merge pull request #583 from jamesray1/patch-10
DavidKnott Dec 21, 2017
a526598
Update dockerfile to use slim image base
mbeacom Dec 22, 2017
48c67c8
Remove commented out directives
mbeacom Dec 22, 2017
33f96d4
Reduce num256_add gas cost
DavidKnott Dec 22, 2017
6e79688
Tag built image as viper
mbeacom Dec 23, 2017
d6c0e1d
Merge pull request #600 from mbeacom/slim-docker
DavidKnott Dec 24, 2017
9a218f7
Add built-in function docs
DavidKnott Dec 22, 2017
fb7fe14
Merge pull request #589 from DavidKnott/fix-logging-with-units
DavidKnott Dec 25, 2017
d6c60bd
Fix on chain market maker
DavidKnott Dec 20, 2017
2c201be
Add comments to on chain market maker
DavidKnott Dec 21, 2017
c5061d2
Merge pull request #603 from DavidKnott/improve-safemath
DavidKnott Dec 25, 2017
73512a6
Merge pull request #598 from DavidKnott/fix-market-maker
DavidKnott Dec 25, 2017
eb4b1dd
Merge pull request #604 from DavidKnott/add-functions-docs
DavidKnott Dec 25, 2017
8efc8e0
Change badges from viper to vyper
DavidKnott Dec 25, 2017
c0c50da
Merge pull request #569 from DavidKnott/add-modulo-math-checks
DavidKnott Dec 25, 2017
2403fda
Merge pull request #610 from DavidKnott/change-badges
DavidKnott Dec 25, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
If you're proposing a new feature please follow the [VIP Template] (https://github.com/ethereum/viper/tree/master/.github/VIP_TEMPLATE.md)

* viper Version: x.x.x
* pyethereum Version: x.x.x
* OS: osx/linux/win
Expand Down
31 changes: 31 additions & 0 deletions .github/VIP_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
This is the suggested template for new VIPs.

## Preamble

VIP: <to be assigned>
Title: <VIP title>
Author: <list of authors' names and optionally, email addresses>
Type: <Standard Track | Informational | Meta>
Status: Draft
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
Requires (*optional): <VIP number(s)>
Replaces (*optional): <VIP number(s)>


## Simple Summary
"If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the VIP.

## Abstract
A short description of the technical issue being addressed.

## Motivation
The motivation is critical for VIPs that add or change Viper's functionality. It should clearly explain why the existing Viper functionality is inadequate to address the problem that the VIP solves as well as how the VIP is in line with Viper's goals and design philosopy.

## Specification
The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow any developer to implement the functionality

## Backwards Compatibility
All VIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The VIP must explain how the author proposes to deal with these incompatibilities.

## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ htmlcov/
docs/_build
docs/modules.rst

# IDEs
.idea/
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
FROM python:3.6
FROM python:3.6-slim

MAINTAINER Obul <obulpathi@merkletree.vc>
# Specify label-schema specific arguments and labels.
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="viper" \
org.label-schema.description="Viper is an experimental programming language" \
org.label-schema.url="https://viper.readthedocs.io/en/latest/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/ethereum/viper" \
org.label-schema.vendor="Ethereum" \
org.label-schema.schema-version="1.0"

# coincurve requires libgmp
RUN apt-get update && \
apt-get install -y libgmp-dev
apt-get install -y --no-install-recommends apt-utils gcc libc6-dev libc-dev libssl-dev libgmp-dev && \
rm -rf /var/lib/apt/lists/*

ADD . /code

# download and install Viper
WORKDIR /code
RUN git clone https://github.com/ethereum/viper.git
WORKDIR /code/viper
RUN python setup.py install
RUN python setup.py install && \
apt-get purge -y --auto-remove apt-utils gcc libc6-dev libc-dev libssl-dev
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ docs:
$(MAKE) -C docs clean
$(MAKE) -C docs html
open docs/_build/html/index.html

docker-build:
@docker build -t viper \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` .
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Join the chat at https://gitter.im/bethereum/viper](https://badges.gitter.im/ethereum/viper.svg)](https://gitter.im/ethereum/viper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/ethereum/viper.svg?branch=master)](https://travis-ci.org/ethereum/viper)
[![Documentation Status](https://readthedocs.org/projects/viper/badge/?version=latest)](http://viper.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://coveralls.io/repos/github/ethereum/viper/badge.svg?branch=master)](https://coveralls.io/github/ethereum/viper?branch=master)
[![Join the chat at https://gitter.im/bethereum/vyper](https://badges.gitter.im/ethereum/vyper.svg)](https://gitter.im/ethereum/vyper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/ethereum/vyper.svg?branch=master)](https://travis-ci.org/ethereum/vyper)
[![Documentation Status](https://readthedocs.org/projects/vyper/badge/?version=latest)](http://vyper.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://coveralls.io/repos/github/ethereum/vyper/badge.svg?branch=master)](https://coveralls.io/github/ethereum/vyper?branch=master)

# Principles and Goals

Expand Down Expand Up @@ -31,7 +31,7 @@ Viper does NOT strive to be a 100% replacement for everything that can be done i
**Note: Viper is still alpha software, use with care**

# Installation
See the [Viper documentation](https://viper.readthedocs.io/en/latest/installing-viper.html)
See the [Viper documentation](https://vyper.readthedocs.io/en/latest/installing-viper.html)
for build instructions.

# Compiling a contract
Expand Down Expand Up @@ -59,5 +59,5 @@ For testing strategy, please see [Testing](no-link)
# Contributing
* See Issues tab, and feel free to submit your own issues
* Add PRs if you discover a solution to an existing issue
* For further discussions and questions talk to us on [gitter](https://gitter.im/ethereum/viper)
* For more information, see [Contributing](http://viper.readthedocs.io/en/latest/contributing.html)
* For further discussions and questions talk to us on [gitter](https://gitter.im/ethereum/vyper)
* For more information, see [Contributing](http://vyper.readthedocs.io/en/latest/contributing.html)
10 changes: 9 additions & 1 deletion bin/viper
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,30 @@ import viper

from viper import compiler, optimizer
from viper.parser.parser import parse_to_lll
from viper.parser import parser_utils


parser = argparse.ArgumentParser(description='Viper {0} programming language for Ethereum'.format(viper.__version__))
parser.add_argument('input_file', help='Viper sourcecode to compile')
parser.add_argument('-f', help='Format to print', choices=['abi', 'json', 'bytecode', 'ir'], default='bytecode', dest='format')
parser.add_argument('-f', help='Format to print', choices=['abi', 'json', 'bytecode', 'bytecode_runtime', 'ir'], default='bytecode', dest='format')
parser.add_argument('--show-gas-estimates', help='Show gas estimates in ir output mode.', action="store_true")

args = parser.parse_args()

if __name__ == '__main__':

with open(args.input_file) as fh:
code = fh.read()
if args.show_gas_estimates:
parser_utils.LLLnode.repr_show_gas = True

if args.format == 'abi':
print(compiler.mk_full_signature(code))
elif args.format == 'json':
print(json.dumps(compiler.mk_full_signature(code)))
elif args.format == 'bytecode':
print('0x' + compiler.compile(code).hex())
elif args.format == 'bytecode_runtime':
print('0x' + compiler.compile(code, bytecode_runtime=True).hex())
elif args.format == 'ir':
print(optimizer.optimize(parse_to_lll(code)))
230 changes: 230 additions & 0 deletions docs/built-in-functions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
.. index:: function, built-in;

.. _built_in_functions:

***********************
Built in Functions
***********************

Viper contains a set amount of built in functions that would be timely and/or unachievable to write in Viper.

.. _functions:

Functions
=========
* **floor**
::

def floor(a) -> b:
"""
:param a: value to round down
:type a: either decimal or num

:output b: integer
"""
Rounds a decimal down to the nearest integer.

* **decimal**
::

def decimal(a) -> b:
"""
:param a: value to turn into decimal
:type a: either decimal or num

:output b: decimal
"""
Turns a number into a decimal.

* **as_unitless_number**
::

def as_unitless_number(a) -> b:
"""
:param a: value to remove units from
:type a: either decimal or num

:output b: either decimal or num
"""
Turns a ``num`` or ``decimal`` with units into one without units (used for assignment and math).

* **as_num128**
::

def as_num128(a) -> b:
"""
:param a: value to turn into int128
:type a: either num, bytes32, num256, or bytes

:output b: num
"""
Turns input into a ``num`` (int128).

* **as_num256**
::

def as_num256(a) -> b:
"""
:param a: value to turn into num256
:type a: either num_literal, num, bytes32, or address

:output b: num256
"""
Turns input into a ``num256`` (uint256).

* **as_bytes32**
::

def as_bytes32(a) -> b:
"""
:param a: value to turn into bytes32
:type a: either num, num256, address

:output b: bytes32
"""
Turns input into a ``bytes32``.
* **slice**
::

def slice(a, start=b, length=c) -> d:
"""
:param a: bytes to be sliced
:type a: either bytes or bytes32
:param b: start position of the slice
:type b: num
:param c: length of the slice
:type c: num

:output d: bytes
"""
Takes a list of bytes and copies, then returns a specified chunk.

* **len**
::

def len(a) -> b:
"""
:param a: value to get the length of
:type a: bytes

:output b: num
"""
Returns the length of a given list of bytes.

* **concat**
::

def concat(a, b, ...) -> c:
"""
:param a: value to combine
:type a: bytes
:param b: value to combine
:type b: bytes

:output b: bytes
"""
Takes 2 or more bytes arrays of type ``bytes32`` or ``bytes`` and combines them into one.

* **keccak256 (sha3)**
::

def keccak256(a) -> b:
"""
:param a: value to hash
:type a: either str_literal, bytes, bytes32

:output b: bytes32
"""
Returns ``keccak_256`` (Ethereums sha3) hash of input.

* **method_id**
::

def method_id(a) -> b:
"""
:param a: method declaration
:type a: str_literal

:output b: bytes
"""

Takes a function declaration and returns its method_id (used in data field to call it).

* **ecrecover**
::

def ecrecover(hash, v, r, s) -> b:
"""
:param hash: a signed hash
:type hash: bytes32
:param v:
:type v: num256
:param r: elliptic curve point
:type r: num256
:param s: elliptic curve point
:type s: num256

:output b: address
"""

Takes a signed hash and vrs and returns the public key of the signer.

* **ecadd**
::

def ecadd(a, b) -> sum:
"""
:param a: pair to be added
:type a: num252[2]
:param b: pair to be added
:type b: num252[2]

:output sum: num256[2]
"""

Takes two elliptical curves and adds them together.

* **ecmul**
::

def ecmul(a, b) -> product:
"""
:param a: pair to be multiplied
:type a: num252[2]
:param b: pair to be multiplied
:type b: num252[2]

:output product: num256[2]
"""

Takes two elliptical curves and multiplies them together.

* **extract32**
::

def extract32(a, b, type=c) -> d:
"""
:param a: where 32 bytes are extracted from
:type a: bytes
:param b: start point of bytes to be extracted
:type b: num
:param c: type of output
:type c: either bytes32, num128, or address

:output d: either bytes32, num128, or address
"""

Takes a byte array and extracts 32 bytes from it.

* **bytes_to_num**
::

def bytes_to_num(a) -> b:
"""
:param a: bytes to be transformed
:type a: bytes

:output d: num
"""

Transforms bytes to num.
2 changes: 1 addition & 1 deletion docs/compiling-a-contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To compile a contract, use:
viper yourFileName.v.py

.. note::
Since .vy is not official a language supported by any syntax highlighters or linters,
Since .vy is not officially a language supported by any syntax highlighters or linters,
it is recommended to name your Viper file ending with `.v.py` in order to have Python syntax highlighting.

An `online compiler <https://viper.tools/>`_ is available as well, which lets you experiment with
Expand Down
Loading