# Data Flow and Interactions

SafleID contracts are designed to facilitate various functionalities through a series of well-defined methods. Below is an explanation of the key functionalities provided by the SafleID system:<br>

### **Registration Functionalities (RegistrarMain Contract)**

1. **Register SafleID**: This method registers a SafleID corresponding to a provided wallet address.

   <pre class="language-solidity" data-overflow="wrap" data-full-width="false"><code class="lang-solidity"><strong>function registerSafleId(address _userAddress, string memory _safleId) public
   </strong>
   </code></pre>

   * **Parameters**: `_userAddress` - The address of the user. `_safleId` - The desired SafleID.
   * **Purpose**: Enables users to create a new SafleID linked to their wallet address.\ <br>
2. **Update SafleID**: This method updates an existing SafleID mapped to a wallet address.

   <pre class="language-solidity" data-overflow="wrap" data-full-width="true"><code class="lang-solidity">function updateSafleId(address _userAddress, string memory _newSafleId) public

   </code></pre>

   * **Parameters**: `_userAddress` - The address of the user. `_newSafleId` - The new SafleID to be updated.
   * **Purpose**: Allows users to change their existing SafleID to a new one.\ <br>
3. **Map Other Coins**: This method enables the linking of wallet addresses from other blockchains to the SafleID.

   <pre class="language-solidity" data-overflow="wrap" data-full-width="true"><code class="lang-solidity">function mapCoins(uint256 _indexnumber, string calldata _blockchainName, string calldata _aliasName) external returns (bool)

   </code></pre>

   * **Parameters**: `_indexnumber` - The index number for mapping. `_blockchainName` - The name of the blockchain. `_aliasName` - The alias for the coin.
   * **Purpose**: Facilitates multi-chain support by allowing users to map other blockchain addresses to their SafleID.\ <br>
4. **Register Coin Address**: This method links a wallet address on another blockchain to the SafleID.

   <pre class="language-solidity" data-overflow="wrap" data-full-width="true"><code class="lang-solidity">function registerCoinAddress(address _userAddress,uint256 _index, string calldata _address) external returns (bool)

   </code></pre>

   * **Parameters**: `_userAddress` - The address of the user. `_index` - The index for the coin. `_address` - The wallet address on the other blockchain.
   * **Purpose**: Allows users to link addresses from other blockchains to their SafleID.\ <br>
5. **Update Coin Address**: This method updates the address mapped to a SafleID on a specific blockchain.

   <pre class="language-solidity" data-overflow="wrap" data-full-width="true"><code class="lang-solidity">function updateCoinAddress(address _userAddress,uint256 _index, string calldata _address) external returns (bool)

   </code></pre>

   * **Parameters**: `_userAddress` - The address of the user. `_index` - The index for the coin. `_address` - The new wallet address.
   * **Purpose**: Enables users to update their linked addresses on other blockchains.
