I would like to concatenate an Ethereum address to an uint in Solidity. How can I do that?
[Ethereum] How to concatenate uint to address in solidity
go-ethereumremixsoliditystring
go-ethereumremixsoliditystring
I would like to concatenate an Ethereum address to an uint in Solidity. How can I do that?
Best Answer
You have not specified which base you want each operand represented by (for example, decimal base for the
uint
operand and hexadecimal base for theaddress
operand), so here are the likely options:Note that when executed in a transaction (i.e., from a non-constant contract function), each one of these functions may yield a relatively high gas-cost.
Here is a Truffle test of the contract above: