From 0438b23ef9629cc8afc4cb0251c839e964a163fa Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 9 Jan 2025 08:50:48 +0700 Subject: [PATCH 1/3] feat: circle decoder first draft --- .../Protocols/CircleDecoderAndSanitizer.sol | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol diff --git a/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol b/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol new file mode 100644 index 0000000..6335acf --- /dev/null +++ b/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.21; + +import { BaseDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/BaseDecoderAndSanitizer.sol"; + +abstract contract TempestDecoderAndSanitizer is BaseDecoderAndSanitizer { + function depositForBurn( + uint256 amount, + uint32 destinationDomain, + bytes32 mintRecipient, + address burnToken + ) + external + view + returns (bytes memory addressesFound) + { + addressesFound = abi.encodePacked(destinationDomain, mintRecipient, burnToken); + } + + function receiveMessage(bytes message, bytes attestation) external view returns (bytes memory addressesFound) { + // nothing to sanitize + } +} From 17769b2c343906a42aa304f05b5d7b120f99da06 Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 14 Jan 2025 02:43:11 +0700 Subject: [PATCH 2/3] fix: incorrect name --- .../Protocols/CircleDecoderAndSanitizer.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol b/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol index 6335acf..8ae9970 100644 --- a/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol +++ b/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.21; import { BaseDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/BaseDecoderAndSanitizer.sol"; -abstract contract TempestDecoderAndSanitizer is BaseDecoderAndSanitizer { +abstract contract CircleDecoderAndSanitizer is BaseDecoderAndSanitizer { function depositForBurn( uint256 amount, uint32 destinationDomain, From f2ef02d067179c051f70582682beadba4fb25ada Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 14 Jan 2025 03:00:20 +0700 Subject: [PATCH 3/3] fix: missing memory locations --- .../Protocols/CircleDecoderAndSanitizer.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol b/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol index 8ae9970..820695f 100644 --- a/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol +++ b/src/base/DecodersAndSanitizers/Protocols/CircleDecoderAndSanitizer.sol @@ -17,7 +17,7 @@ abstract contract CircleDecoderAndSanitizer is BaseDecoderAndSanitizer { addressesFound = abi.encodePacked(destinationDomain, mintRecipient, burnToken); } - function receiveMessage(bytes message, bytes attestation) external view returns (bytes memory addressesFound) { + function receiveMessage(bytes memory message, bytes memory attestation) external view returns (bytes memory addressesFound) { // nothing to sanitize } }