User Interaction
Note: This approach is only required if the user wants to interact directly with the contracts. dApps should use this process so users don't need to interact directly with the contract, improving the user experience.
Requesting Bridge Transfer
Since the contracts in each blockchain are different, the contract call to start this process will change depending on the source blockchain. Below it is possible to see the options:
EVM-Compatible Chain → Klever Blockchain
In this case, to start the bridge process, the user needs to call the Safe smart contract on the Ethereum side:
deposit (address tokenAddress, uint256 amount, bytes32 recipientAddress)
Where the address is the token address that the user wants to bridge, amount refers to the value bridged and the recipientAddress, as the name suggests, is the address that will receive the tokens in the Klever Blockchain.
Klever Blockchain → EVM-Compatible Chain
For Klever Blockchain, the user can request the token bridge by interacting with the Safe Smart contract on Klever Blockchain side:
#[payable("*")]
createTransaction (to EthAddress)
Where the "to" refers to the address that will receive the tokens on the ETH side. This method is payable, which means it can receive a payment when calling the method, this payment needs to be the tokens the user wants to bridge.
User Fee for Relayer Services: During transfers from Klever Blockchain to EVM chains, users pay a fee that compensates relayers for processing and validating the cross-chain transaction. This fee is automatically deducted from the bridged amount and held in the safe smart contract for later distribution to relayers. For more details about how relayer fees work, see the Relayers documentation.
After the user deposit
As mentioned in the Transfer flow documentation, all relayers will be checking the Safe smart contract to check if there are pending transactions to be bridged. When a certain number of transactions is reached or a quantity of blocks has passed, the relayers will realize the bridge process and the user will receive their tokens. There is no other interaction needed for the user.