Skip to content

Commit

Permalink
readme: mock encoding docs
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Dec 13, 2023
1 parent 4b5c4ef commit d3a6950
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/apps/mock/README.md
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))
)
}
```

0 comments on commit d3a6950

Please sign in to comment.