Created
February 8, 2019 14:23
-
-
Save kolya-t/afbd0a0d8127c2528558590dd87a8422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.3 <0.6.0; | |
contract TronRegister { | |
event RegisterAdd(address indexed ethAddress, address indexed tronAddress); | |
mapping(address => address) private ethToTronMapping; | |
function put(address _tronAddress) external { | |
address ethAddress = msg.sender; | |
require(ethToTronMapping[ethAddress] == address(0), "address already bound"); | |
ethToTronMapping[ethAddress] = _tronAddress; | |
emit RegisterAdd(ethAddress, _tronAddress); | |
} | |
function get(address _ethAddress) public view returns (address _tronAddress) { | |
return ethToTronMapping[_ethAddress]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment