Skip to content

Commit

Permalink
feat: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
cosinlink committed Sep 3, 2024
1 parent 23ab1e2 commit 7f893f5
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions contracts/deprecated/CrossChain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,40 +139,6 @@ contract CrossChain is System, ICrossChain, IParamSubscriber {
alreadyInit = true;
}

function encodePayload(
uint8 packageType,
uint256 relayFee,
bytes memory msgBytes
) public pure returns (bytes memory) {
uint256 payloadLength = msgBytes.length + 33;
bytes memory payload = new bytes(payloadLength);
uint256 ptr;
assembly {
ptr := payload
}
ptr += 33;

assembly {
mstore(ptr, relayFee)
}

ptr -= 32;
assembly {
mstore(ptr, packageType)
}

ptr -= 1;
assembly {
mstore(ptr, payloadLength)
}

ptr += 65;
(uint256 src,) = Memory.fromBytes(msgBytes);
Memory.copy(src, ptr, msgBytes.length);

return payload;
}

function handlePackage(
bytes calldata payload,
bytes calldata proof,
Expand Down

0 comments on commit 7f893f5

Please sign in to comment.