TwoKeyRegistry
contract TwoKeyRegistry
Index
- UserNameChanged
- addName
- addNameAndSetWalletName
- addNameInternal
- addNameSigned
- addPlasma2EthereumByUser
- address2username
- address2walletTag
- checkIfUserExists
- getEthereumToPlasma
- getPlasmaToEthereum
- getUserAddress2UserName
- getUserData
- getUserName2UserAddress
- isMaintainer
- notes
- setInitialParams
- setNoteByUser
- setPlasma2EthereumAndNoteSigned
- setWalletName
- username2currentAddress
- walletTag2address
Reference
Events
UserNameChanged
event UserNameChanged(address owner, string name)Event is emitted when a user's name is changed.
- Parameters:
owner- addressname- string
Functions
addName
function addName(string _name, address _sender, string _fullName, string _email, bytes signature) publicFunction where only admin can add a name - address pair.
- Parameters:
_name- is name of user_sender- is address of user_fullName- string_email- stringsignature- bytes
addNameAndSetWalletName
function addNameAndSetWalletName(string _name, address _sender, string _fullName, string _email, string _username_walletName, bytes _signatureName, bytes _signatureWalletName) publicFunction to concat this 2 functions at once.
- Parameters:
_name- string_sender- address_fullName- string_email- string_username_walletName- string_signatureName- bytes_signatureWalletName- bytes
addNameInternal
function addNameInternal(string _name, address _sender) internalPrivate function, Function where new name/address pair is added or an old address is updated with new name.
- Parameters:
_name- is name of user_sender- is address of user
addNameSigned
function addNameSigned(string _name, bytes external_sig) publicAdd signed name.
- Parameters:
_name- is the nameexternal_sig- is the external signature
addPlasma2EthereumByUser
function addPlasma2EthereumByUser(bytes sig) public- Parameters:
sig- bytes
address2username
function address2username(address keyAddress) public view returns (string)- Parameters:
keyAddress- address- Returns:
- string
address2walletTag
function address2walletTag(address keyAddress) public view returns (bytes32)- Parameters:
keyAddress- address- Returns:
- bytes32
checkIfUserExists
function checkIfUserExists(address _userAddress) external view returns (bool)Function to check if the user exists.
- Parameters:
_userAddress- is the address of the user- Returns:
- true if exists otherwise false
getEthereumToPlasma
function getEthereumToPlasma(address ethereum) public view returns (address)Reading from mapping plasma 2 ethereum.
- Parameters:
ethereum- is the ethereum address we're searching plasma address for- Returns:
- plasma address if exist otherwise 0x0 (address(0))
getPlasmaToEthereum
function getPlasmaToEthereum(address plasma) public view returns (address)Reading from mapping ethereum 2 plasma.
- Parameters:
plasma- is the plasma address we're searching eth address for- Returns:
- ethereum address if exist otherwise 0x0 (address(0))
getUserAddress2UserName
function getUserAddress2UserName(address _sender) external view returns (string)View function - doesn't cost any gas to be executed, Function to fetch name that corresponds to the address.
- Parameters:
_sender- is address of user- Returns:
- name of the user as type string
getUserData
function getUserData(address _user) external view returns (bytes)- Parameters:
_user- address- Returns:
- bytes
getUserName2UserAddress
function getUserName2UserAddress(string _name) external view returns (address)View function - doesn't cost any gas to be executed, Function to fetch address of the user that corresponds to given name.
- Parameters:
_name- is name of user- Returns:
- address of the user as type address
isMaintainer
function isMaintainer(address x) internal view returns (bool)- Parameters:
x- address- Returns:
- bool
notes
function notes(address keyAddress) public view returns (bytes)- Parameters:
keyAddress- address- Returns:
- bytes
setInitialParams
function setInitialParams(address _twoKeySingletonesRegistry, address _proxyStorage) externalFunction which can be called only once.
- Parameters:
_twoKeySingletonesRegistry- address_proxyStorage- address
setNoteByUser
function setNoteByUser(bytes note) public- Parameters:
note- bytes
setPlasma2EthereumAndNoteSigned
function setPlasma2EthereumAndNoteSigned(bytes sig, bytes note, bytes external_sig) public- Parameters:
sig- bytesnote- bytesexternal_sig- bytes
setWalletName
function setWalletName(string username, address _address, string _username_walletName, bytes signature) publicFunction where TwoKeyMaintainer can add walletname to address.
- Parameters:
username- is the username of the user we want to update map for_address- is the address of the user we want to update map for_username_walletName- is the concatenated username + '_' + walletName, since sending from trusted provider no need to validatesignature- bytes
username2currentAddress
function username2currentAddress(bytes32 _username) public view returns (address)- Parameters:
_username- bytes32- Returns:
- address
walletTag2address
function walletTag2address(bytes32 walletTag) public view returns (address)- Parameters:
walletTag- bytes32- Returns:
- address