Skip to content

Commit

Permalink
Added payload size check from the internal contract
Browse files Browse the repository at this point in the history
  • Loading branch information
0xIryna committed Feb 4, 2023
1 parent 9bd53b6 commit 7d07e87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/RelayerV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ contract RelayerV2 is ReentrancyGuard, OwnableUpgradeable, Proxied, ILayerZeroRe
}

function getFee(uint16 _dstChainId, uint16 _outboundProofType, address _userApplication, uint _payloadSize, bytes calldata _adapterParams) external view override returns (uint) {
require(_payloadSize <= 10000, "Relayer: _payloadSize tooooo big");
(uint basePrice, uint pricePerByte) = _getPrices(_dstChainId, _outboundProofType, _userApplication, _adapterParams);
return basePrice.add(_payloadSize.mul(pricePerByte));
}
Expand All @@ -147,6 +148,7 @@ contract RelayerV2 is ReentrancyGuard, OwnableUpgradeable, Proxied, ILayerZeroRe

function assignJob(uint16 _dstChainId, uint16 _outboundProofType, address _userApplication, uint _payloadSize, bytes calldata _adapterParams) external override returns (uint) {
require(msg.sender == address(uln), "Relayer: invalid uln");
require(_payloadSize <= 10000, "Relayer: _payloadSize tooooo big");
(uint basePrice, uint pricePerByte) = _getPrices(_dstChainId, _outboundProofType, _userApplication, _adapterParams);
uint totalFee = basePrice.add(_payloadSize.mul(pricePerByte));
emit AssignJob(totalFee);
Expand Down

3 comments on commit 7d07e87

@kedilungdiakbo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooooo after payload looks crazy in the code

@OGUNDSMZ
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish you continued success, I am with you.

@Mody6595
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am with you on that 🔥❤

Please sign in to comment.