What is the recommended way to convert an address
to bytes
in Solidity?
Solidity Address to Bytes – How to Convert an Address to Bytes
addressesbytescontract-developmentsolidity
Related Topic
- solidity – How to Convert Bytes to Address in Solidity
- Bytes to String Conversion – How to Convert a Bytes to String in Solidity?
- Solidity – Convert ‘bytes memory’ to ‘bytes8’
- [Ethereum] Solidity convert hex string to bytes
- Solidity Conversion – How to Convert Bytes to Uint in Solidity
- Solidity Strings – Convert Address to String After Solidity 0.5.x
Best Answer
To be even more efficient:
Takes just 695 gas vs 2500 for Gokulnath's answer and 5000 for Eth's
Edit for solidity ^0.5.0:
This is almost as efficient and much more readable: