Skip to content

Commit

Permalink
Add param checks back
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Apr 11, 2024
1 parent 923187e commit 3dd1adc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/src/Gateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ contract Gateway is IGateway, IInitializable {
error InvalidCodeHash();
error InvalidConstructorParams();
error AlreadyInitialized();
error InvalidTransact();

// handler functions are privileged
modifier onlySelf() {
Expand Down Expand Up @@ -647,6 +648,9 @@ contract Gateway is IGateway, IInitializable {
Weight calldata weightAtMost,
bytes calldata call
) external payable {
if (call.length == 0 || destinationFee == 0 || weightAtMost.refTime == 0 || weightAtMost.proofSize == 0) {
revert InvalidTransact();
}
bytes memory payload =
SubstrateTypes.Transact(msg.sender, originKind.encode(), destinationFee, weightAtMost, call);
Costs memory costs = _calculateTransactCost(destinationFee);
Expand Down

0 comments on commit 3dd1adc

Please sign in to comment.