0

I am trying to abi encode a function abc(address, string)

the encoding looks like this

Address.delegateCall(abi.encodeWithSignature("abc(address,string)", _address, _string))

but I actually want to attach another variable which is not part of the function parameter

Address.delegateCall(abi.encodeWithSignature("abc(address,string)", _address, _string, _myaddress))

I saw this being possible in Meta transactions trusted forwarder (here) contract with abi.encodePacked how to achieve this ?

1 Answer 1

0

Seems like abi.encode, with signature , with selector all has same underlying encoding same. but packed is compressed version of it

Address.delegateCall(abi.encodePacked(abi.encodeWithSignature("abc(address,string)", _address, _string), _myaddress)

achieves it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.