Convert Bytes to address

sourhsourh Member Posts: 5
Hello! how can I convert bytes to address please ?
I want to sent an address in transaction to my smart contract and then I want to display it from the SC, I think I sould convert the bytes to address to be able to use it:
this is my transaction
token.addAssets.sendTransaction(1,{from: web3.eth.accounts[0], value: web3.toWei(1, 'ether'), data: web3.toHex("0x228aef67c65077f864d9f5e00697578627f3b331")});

and this is my smart contract function

function addAssets(int amount) returns (bytes)
{ad=msg.data;
if (msg.sender == 0xd1b4b395a0f9deff0275c3cca2eeb9539af365e2)
balanceOf[msg.sender]=balanceOf[msg.sender]+amount;
else throw;
return ad;
}
in this function I just want to read the address, any help please where is the error ?
Sign In or Register to comment.