Skip to content

Commit

Permalink
no empty sender recip [SLT-184] (#3171)
Browse files Browse the repository at this point in the history
* no empty sender/to addrs [SLT-184]

* enable tests

* code reformat
  • Loading branch information
parodime authored Sep 26, 2024
1 parent 96bf50f commit e897b18
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions packages/contracts-rfq/contracts/FastBridgeV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ contract FastBridgeV2 is Admin, IFastBridgeV2, IFastBridgeV2Errors {
// check bridge params
if (params.dstChainId == block.chainid) revert ChainIncorrect();
if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();
if (params.sender == address(0) || params.to == address(0)) revert ZeroAddress();
if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();
if (params.deadline < block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();

Expand Down
2 changes: 0 additions & 2 deletions packages/contracts-rfq/test/FastBridgeV2.Src.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,12 @@ contract FastBridgeV2SrcTest is FastBridgeV2Test {
}

function test_bridge_revert_zeroSender() public {
vm.skip(true); // TODO: unskip when fixed
tokenParams.sender = address(0);
vm.expectRevert(ZeroAddress.selector);
bridge({caller: userA, msgValue: 0, params: tokenParams});
}

function test_bridge_revert_zeroRecipient() public {
vm.skip(true); // TODO: unskip when fixed
tokenParams.to = address(0);
vm.expectRevert(ZeroAddress.selector);
bridge({caller: userA, msgValue: 0, params: tokenParams});
Expand Down

0 comments on commit e897b18

Please sign in to comment.