current position:Home>How to convert bytes type into address type in solidity

How to convert bytes type into address type in solidity

2022-02-03 20:46:52 Q & A of Denglian community

Solidity in bytes How to convert a type to an address address type




Take the answer 1:

The conversion method is as follows :

function bytesToAddress(bytes memory bys) external pure returns (address addr) { assembly {   addr := mload(add(bys,20)) }



copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032046501493.html

Random recommended