From 73f19a880faed0515f0fdcd9ed35248a70a1028c Mon Sep 17 00:00:00 2001 From: Mike Keen Date: Thu, 10 May 2018 14:52:38 -0400 Subject: [PATCH 1/5] Fixes #606 --- docs/built-in-functions.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index fa1b399803..e724db22ef 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -229,3 +229,30 @@ Takes two elliptical curves and multiplies them together. :output d: either bytes32, num128, or address """ + +**RLPList** +--------------- +:: + + def RLPList(a, b) -> c: + """ + :param a: encoded data + :type a: bytes + :param b: RLP list + :type b: list + + :output c: LLLnode + """ + +Takes encoded RLP data and an unencoded list of types. Usage:: + + vote_msg: bytes <= 1024 = ... + + values = RLPData(vote_msg, [int128, int128, bytes32, bytes, bytes]) + + var1: int128 = values[0] + var2: int128 = values[1] + var3: bytes32 = values[2] + var4: bytes <= 1024 = values[3] + var5: bytes <= 1024 = values[4] + From ccae2854061c810967dda3ed057c61f34f69eba6 Mon Sep 17 00:00:00 2001 From: Mike Keen Date: Thu, 10 May 2018 15:05:13 -0400 Subject: [PATCH 2/5] Fixed incorrect label --- docs/built-in-functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index e724db22ef..5d8b4d9c10 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -248,7 +248,7 @@ Takes encoded RLP data and an unencoded list of types. Usage:: vote_msg: bytes <= 1024 = ... - values = RLPData(vote_msg, [int128, int128, bytes32, bytes, bytes]) + values = RLPList(vote_msg, [int128, int128, bytes32, bytes, bytes]) var1: int128 = values[0] var2: int128 = values[1] From 47a791bba645d78c8b8ac7db8b3719c1c6284ad5 Mon Sep 17 00:00:00 2001 From: Mike Keen Date: Thu, 10 May 2018 17:22:48 -0400 Subject: [PATCH 3/5] fixed formatting --- docs/built-in-functions.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index 5d8b4d9c10..ae383fc66e 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -234,15 +234,15 @@ Takes two elliptical curves and multiplies them together. --------------- :: - def RLPList(a, b) -> c: - """ - :param a: encoded data - :type a: bytes - :param b: RLP list - :type b: list - - :output c: LLLnode - """ + def _RLPList(a, b) -> c: + """ + :param a: encoded data + :type a: bytes + :param b: RLP list + :type b: list + + :output c: LLLnode + """ Takes encoded RLP data and an unencoded list of types. Usage:: From cda40db24db214c2701df5e6fe0986232f920fae Mon Sep 17 00:00:00 2001 From: Mike Keen Date: Thu, 10 May 2018 17:31:44 -0400 Subject: [PATCH 4/5] fixed formatting --- docs/built-in-functions.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index ae383fc66e..15742b0991 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -234,25 +234,25 @@ Takes two elliptical curves and multiplies them together. --------------- :: - def _RLPList(a, b) -> c: - """ - :param a: encoded data - :type a: bytes - :param b: RLP list - :type b: list + def _RLPList(a, b) -> c: + """ + :param a: encoded data + :type a: bytes + :param b: RLP list + :type b: list - :output c: LLLnode - """ + :output c: LLLnode + """ Takes encoded RLP data and an unencoded list of types. Usage:: - vote_msg: bytes <= 1024 = ... + vote_msg: bytes <= 1024 = ... - values = RLPList(vote_msg, [int128, int128, bytes32, bytes, bytes]) + values = RLPList(vote_msg, [int128, int128, bytes32, bytes, bytes]) - var1: int128 = values[0] - var2: int128 = values[1] - var3: bytes32 = values[2] - var4: bytes <= 1024 = values[3] - var5: bytes <= 1024 = values[4] + var1: int128 = values[0] + var2: int128 = values[1] + var3: bytes32 = values[2] + var4: bytes <= 1024 = values[3] + var5: bytes <= 1024 = values[4] From a43ac25c1c03f3a9a144f4d7c30abd0e95888a3c Mon Sep 17 00:00:00 2001 From: Mike Keen Date: Tue, 15 May 2018 13:43:58 -0400 Subject: [PATCH 5/5] added rlp decoder deploy notes --- docs/built-in-functions.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index 15742b0991..a76036fe0a 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -256,3 +256,12 @@ Takes encoded RLP data and an unencoded list of types. Usage:: var4: bytes <= 1024 = values[3] var5: bytes <= 1024 = values[4] +Note: RLP decoder needs to be deployed if one wishes to use it outside of the Vyper test suite. Eventually, the decoder will be available on mainnet at a fixed address. But for now, here's how to create RLP decoder on other chains: + +\1. send 6270960000000000 wei to 0xd2c560282c9C02465C2dAcdEF3E859E730848761 + +\2. Publish this tx to create the contract:: + + 0xf90237808506fc23ac00830330888080b902246102128061000e60003961022056600060007f010000000000000000000000000000000000000000000000000000000000000060003504600060c082121515585760f882121561004d5760bf820336141558576001905061006e565b600181013560f783036020035260005160f6830301361415585760f6820390505b5b368112156101c2577f010000000000000000000000000000000000000000000000000000000000000081350483602086026040015260018501945060808112156100d55760018461044001526001828561046001376001820191506021840193506101bc565b60b881121561014357608081038461044001526080810360018301856104600137608181141561012e5760807f010000000000000000000000000000000000000000000000000000000000000060018401350412151558575b607f81038201915060608103840193506101bb565b60c08112156101b857600182013560b782036020035260005160388112157f010000000000000000000000000000000000000000000000000000000000000060018501350402155857808561044001528060b6838501038661046001378060b6830301830192506020810185019450506101ba565bfe5b5b5b5061006f565b601f841315155857602060208502016020810391505b6000821215156101fc578082604001510182826104400301526020820391506101d8565b808401610420528381018161044003f350505050505b6000f31b2d4f + +\3. This is the contract address: 0xCb969cAAad21A78a24083164ffa81604317Ab603