Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for forcall fee to be part of the payload. #114

Merged
merged 2 commits into from
Jun 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions contracts/interfaces/IAxelarForecallable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -99,7 +99,10 @@ 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;
}

Expand Down