fisherBridgeReceive
Function Type: external
Function Signature: fisherBridgeReceive(address,address,address,uint256,uint256,bytes)
Access Control: onlyFisherExecutor
Returns: void
Processes incoming cross-chain deposits mediated by authorized fisher executors. This function validates cryptographic signatures from users and credits their EVVM balances accordingly, enabling gasless deposits through the fisher bridge system.
Parameters
Parameter | Type | Description |
---|---|---|
from | address | Original sender on the external chain |
addressToReceive | address | Recipient address for the EVVM balance credit |
tokenAddress | address | Token contract address or address(0) for native coin |
priorityFee | uint256 | Fee amount paid to the fisher executor |
amount | uint256 | Amount to credit to the recipient's EVVM balance |
signature | bytes | Cryptographic signature (EIP-191) from the from address authorizing this transaction. |
Access Control
This function can only be called by addresses with the fisherExecutor
role:
modifier onlyFisherExecutor() {
if (msg.sender != fisherExecutor.current) {
revert();
}
_;
}
Workflow
1. Signature Verification
if (!SignatureUtils.verifyMessageSignedForFisherBridge(
from,
addressToReceive,
nextFisherExecutionNonce[from],
tokenAddress,
priorityFee,
amount,
signature
)) revert ErrorsLib.InvalidSignature();
Validates that the signature was created by the from
address using the Fisher Bridge signature format. For complete signature requirements and verification process, see the Fisher Bridge Signature Structure documentation.
2. Nonce Increment
nextFisherExecutionNonce[from]++;
Increments the user's nonce to prevent replay attacks.
3. Balance Credits
Recipient Balance Credit
executerEVVM(true, addressToReceive, tokenAddress, amount);
Credits the specified amount
to the recipient's EVVM balance.
Fisher Fee Payment (if applicable)
if (priorityFee > 0)
executerEVVM(true, msg.sender, tokenAddress, priorityFee);
If a priority fee is specified, credits it to the fisher executor's EVVM balance.
Signature Message Format
For more information about the signature structure, refer to the Fisher Bridge Signature Structure.
EVVM Integration
The function uses the internal executerEVVM
helper to interact with the EVVM core contract:
function executerEVVM(
bool typeOfExecution,
address userToExecute,
address token,
uint256 amount
) internal {
if (typeOfExecution) {
// true = add
Evvm(evvmAddress).addAmountToUser(userToExecute, token, amount);
} else {
// false = remove
Evvm(evvmAddress).removeAmountFromUser(userToExecute, token, amount);
}
}
Fisher Bridge Benefits
For Users
- Gasless Transactions: Users don't need native tokens on the host chain
- Flexible Recipients: Can specify different recipient addresses
- Signature-based Authorization: Secure consent without direct interaction
For Fisher Executors
- Priority Fees: Earn fees for facilitating transfers
- Batch Processing: Can process multiple transfers efficiently
- Automated Operations: Enable programmatic cross-chain services
Security Features
Signature Security
- EIP-191 Standard: Uses Ethereum's signed message standard (see signature format)
- Replay Protection: Nonce-based prevention of signature reuse
- Address Binding: Signature tied to specific sender address
Access Control
- Fisher Authorization: Only authorized executors can call the function
- Signature Validation: Cryptographic proof of user consent required (see signature format)
Balance Management
- Direct EVVM Integration: Secure balance updates through authorized treasury functions
- Atomic Operations: Balance credits are processed atomically
Error Conditions
Error | Condition |
---|---|
InvalidSignature | Signature verification fails |
Access Control Revert | Called by unauthorized address (not current fisher executor) |
Usage Example
A typical fisher bridge receive flow:
- User signs a message on external chain authorizing the transfer
- Fisher executor receives the signature and transfer details
- Fisher calls
fisherBridgeReceive
with the signature and transfer parameters - Function validates signature and credits EVVM balances
- User receives tokens in EVVM, fisher receives priority fee (if applicable)
Fisher executors are managed through a time-delayed governance system. See Admin Functions for details on executor management.