diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index fa1b399803..a76036fe0a 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -229,3 +229,39 @@ 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 = 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] + +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