Created
December 17, 2018 06:29
-
-
Save yudetamago/bfc781e9f19036d58393b7c0090b1deb to your computer and use it in GitHub Desktop.
vyper delegatecall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a: public(int128) | |
b: public(address) | |
@public | |
def execute(_to: address, _data: bytes[4096]): | |
raw_call( | |
_to, | |
_data, | |
gas=msg.gas, | |
outsize=0, | |
delegate_call=True | |
) | |
@public | |
def testFunc(_a: int128, _b:address): | |
self.a = _a | |
self.b = _b | |
@public | |
@constant | |
def createCallData(_a: int128, _b:address) -> bytes[68]: | |
cdata: bytes[68] = concat(method_id("testFuc(int128,address)", bytes[4]), convert(_a, bytes32), convert(_b, bytes32)) | |
return cdata |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage in pseudo code