help needed.
mapping(bytes32 => address) tokenSymboltoAddress;
- The function saves tokenAddress on the tokenSymbol key in a mapping.
function addAddresses(bytes32 _name, address _tokenAddress ) {
tokenSymboltoAddress[bytes32] = _tokenAddress;
}
- Returns the address added in the mapping on the given token symbol.
function getAddress(bytes32 name) returns (address) {
return tokenSymboltoAddress[name];
}
Can someone help me how to write or run these functions. How do we write symbol as bytes32 in function argument?
Can we convert bytes32 to string in solidity ?