From 2ed32053bb6763a7174c864887969b60d88c0c29 Mon Sep 17 00:00:00 2001 From: Foivos Date: Fri, 17 Jun 2022 16:44:46 +0300 Subject: [PATCH 1/2] Allow for forcall fee to be part of the payload. --- contracts/interfaces/IAxelarForecallable.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/interfaces/IAxelarForecallable.sol b/contracts/interfaces/IAxelarForecallable.sol index 3602c7ca..3628e5c9 100644 --- a/contracts/interfaces/IAxelarForecallable.sol +++ b/contracts/interfaces/IAxelarForecallable.sol @@ -54,7 +54,7 @@ abstract contract IAxelarForecallable { address forecaller ) external { address token = gateway.tokenAddresses(tokenSymbol); - uint256 amountPost = amountPostFee(amount); + uint256 amountPost = amountPostFee(amount, payload); _safeTransferFrom(token, msg.sender, amountPost); _checkForecallWithToken(sourceChain, sourceAddress, payload, tokenSymbol, amount, forecaller); if (forecallers[keccak256(abi.encode(sourceChain, sourceAddress, payload, tokenSymbol, amount))] != address(0)) @@ -99,7 +99,7 @@ abstract contract IAxelarForecallable { ) internal virtual {} // Override this to keep a fee. - function amountPostFee(uint256 amount) public virtual returns (uint256) { + function amountPostFee(uint256 amount, bytes calldata /*payload*/) public virtual returns (uint256) { return amount; } From 366237de0f01ea1ebe16aa2caecd048d7f85c17b Mon Sep 17 00:00:00 2001 From: Foivos Date: Fri, 17 Jun 2022 16:47:23 +0300 Subject: [PATCH 2/2] prettier. --- contracts/interfaces/IAxelarForecallable.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/interfaces/IAxelarForecallable.sol b/contracts/interfaces/IAxelarForecallable.sol index 3628e5c9..4554f021 100644 --- a/contracts/interfaces/IAxelarForecallable.sol +++ b/contracts/interfaces/IAxelarForecallable.sol @@ -99,7 +99,10 @@ abstract contract IAxelarForecallable { ) internal virtual {} // Override this to keep a fee. - function amountPostFee(uint256 amount, bytes calldata /*payload*/) public virtual returns (uint256) { + function amountPostFee( + uint256 amount, + bytes calldata /*payload*/ + ) public virtual returns (uint256) { return amount; }