Skip to content

Commit

Permalink
Fix relay fee bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yorhodes committed Nov 22, 2024
1 parent 913229b commit ccb3aa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions script/HyperlaneSignIntent.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ contract HyperlaneSignIntent is Script {
address arbiter;
address allocator;
address sponsor;
address claimant;
bytes32 domainSeparator;

uint256 sponsorPrivateKey;
Expand All @@ -35,7 +34,6 @@ contract HyperlaneSignIntent is Script {
allocatorPrivateKey = vm.envUint("ALLOCATOR_PRIVATE_KEY");

// destination fill interface
claimant = vm.envAddress("DEFAULT_CLAIMANT");
address _destinationArbiter = vm.envAddress("ARBITER_TWO");
destination = uint32(vm.envUint("DOMAIN_TWO"));
destinationArbiter = HyperlaneArbiter(_destinationArbiter);
Expand Down
4 changes: 3 additions & 1 deletion src/HyperlaneArbiter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ contract HyperlaneArbiter is Router {

// TODO: support Permit2 fills
address filler = msg.sender;
uint256 hyperlaneFee = msg.value;
if (intent.token == address(0)) {
Address.sendValue(payable(intent.recipient), intent.amount);
hyperlaneFee -= intent.amount;
} else {
intent.token.safeTransferFrom(filler, intent.recipient, intent.amount);
}

_Router_dispatch(
claimChain,
msg.value - intent.amount,
hyperlaneFee,
Message.encode(compact, allocatorSignature, sponsorSignature, hash(intent), intent.fee, filler),
"",
address(hook)
Expand Down

0 comments on commit ccb3aa2

Please sign in to comment.