docs for L1Helper

This commit is contained in:
Alexey 2021-10-26 12:48:37 +03:00
parent 4ce8de3232
commit 039721ed7b
No known key found for this signature in database
GPG Key ID: C77958099D784E76
1 changed files with 8 additions and 4 deletions

View File

@ -4,6 +4,7 @@ pragma abicoder v2;
import "omnibridge/contracts/helpers/WETHOmnibridgeRouter.sol";
/// @dev Extension for original WETHOmnibridgeRouter that stores TornadoPool account registrations.
contract L1Helper is WETHOmnibridgeRouter {
event PublicKey(address indexed owner, bytes key);
@ -18,15 +19,14 @@ contract L1Helper is WETHOmnibridgeRouter {
address _owner
) WETHOmnibridgeRouter(_bridge, _weth, _owner) {}
/** @dev Registers provided public key and its owner in pool
* @param _account pair of address and key
*/
function register(Account memory _account) public {
require(_account.owner == msg.sender, "only owner can be registered");
_register(_account);
}
function _register(Account memory _account) internal {
emit PublicKey(_account.owner, _account.publicKey);
}
/**
* @dev Wraps native assets and relays wrapped ERC20 tokens to the other chain.
* It also calls receiver on other side with the _data provided.
@ -46,4 +46,8 @@ contract L1Helper is WETHOmnibridgeRouter {
_register(_account);
}
}
function _register(Account memory _account) internal {
emit PublicKey(_account.owner, _account.publicKey);
}
}