Skip to content

Commit

Permalink
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
Browse files Browse the repository at this point in the history
…erage
  • Loading branch information
hexonaut committed Jun 5, 2024
2 parents 747c428 + 8190995 commit 05e3840
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/receivers/CCTPReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ contract CCTPReceiver {

address public immutable destinationMessenger;
uint32 public immutable sourceDomainId;
address public immutable sourceAuthority;
bytes32 public immutable sourceAuthority;
address public immutable target;

constructor(
address _destinationMessenger,
uint32 _sourceDomainId,
address _sourceAuthority,
bytes32 _sourceAuthority,
address _target
) {
destinationMessenger = _destinationMessenger;
Expand All @@ -29,9 +29,9 @@ contract CCTPReceiver {
bytes32 sender,
bytes calldata messageBody
) external returns (bool) {
require(msg.sender == destinationMessenger, "CCTPReceiver/invalid-sender");
require(sourceDomainId == sourceDomain, "CCTPReceiver/invalid-sourceDomain");
require(sender == bytes32(uint256(uint160(sourceAuthority))), "CCTPReceiver/invalid-sourceAuthority");
require(msg.sender == destinationMessenger, "CCTPReceiver/invalid-sender");
require(sourceDomainId == sourceDomain, "CCTPReceiver/invalid-sourceDomain");
require(sender == sourceAuthority, "CCTPReceiver/invalid-sourceAuthority");

(bool success, bytes memory ret) = target.call(messageBody);
if (!success) {
Expand Down
4 changes: 2 additions & 2 deletions test/CircleCCTPIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ contract CircleCCTPIntegrationTest is IntegrationBaseTest {
}

function initSourceReceiver() internal override returns (address) {
return address(new CCTPReceiver(bridge.sourceCrossChainMessenger, destinationDomainId, destinationAuthority, address(moSource)));
return address(new CCTPReceiver(bridge.sourceCrossChainMessenger, destinationDomainId, bytes32(uint256(uint160(destinationAuthority))), address(moSource)));
}

function initDestinationReceiver() internal override returns (address) {
return address(new CCTPReceiver(bridge.destinationCrossChainMessenger, sourceDomainId, sourceAuthority, address(moDestination)));
return address(new CCTPReceiver(bridge.destinationCrossChainMessenger, sourceDomainId, bytes32(uint256(uint160(sourceAuthority))), address(moDestination)));
}

function initBridgeTesting() internal override returns (Bridge memory) {
Expand Down

0 comments on commit 05e3840

Please sign in to comment.