-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Mock implementation | ||
|
||
This is a very simple mock implementation of how to verify messages. A designated signer is stored in the contract. If the address is signed by that address it is considered good. | ||
|
||
# Address encoding | ||
|
||
Mock uses 65 bytes to represent addresses. 64 for the address and 1 to describe the length. This is intended to be compatible with the vast majority of chains where 32 bytes might not. | ||
|
||
EVM -> EVM | ||
|
||
```solidity | ||
function _to_bytes65(address target) internal returns(bytes memory) { | ||
return abi.encodePacked( | ||
uint8(20), | ||
bytes32(0), | ||
uint256(uint160(target)) | ||
) | ||
} | ||
``` |