Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ cache
coverage*
gasReporterOutput.json
typechain
artifacts-zk
cache-zk
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
hardhat.config.ts
cache
cache-zk
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ coverage*
gasReporterOutput.json
typechain
dist
artifacts-zk
cache-zk
2 changes: 1 addition & 1 deletion contracts/SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ abstract contract SpokePool is
bytes memory updatedMessage,
bytes memory depositorSignature
) public override nonReentrant {
require(updatedRelayerFeePct < 0.5e18, "invalid relayer fee");
require(SignedMath.abs(updatedRelayerFeePct) < 0.5e18, "Invalid relayer fee");

_verifyUpdateDepositMessage(
depositor,
Expand Down
16 changes: 14 additions & 2 deletions test/SpokePool.Relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ async function testUpdatedFeeSignaling(depositorAddress: string) {
updatedMessage
);

// Cannot set new relayer fee pct >= 50%
// Cannot set new relayer fee pct >= 50% or <= -50%
await expect(
spokePool
.connect(relayer)
Expand All @@ -315,7 +315,19 @@ async function testUpdatedFeeSignaling(depositorAddress: string) {
updatedMessage,
signature
)
).to.be.revertedWith("invalid relayer fee");
).to.be.revertedWith("Invalid relayer fee");
await expect(
spokePool
.connect(relayer)
.speedUpDeposit(
depositorAddress,
toWei("0.5").mul(-1),
consts.firstDepositId,
updatedRecipient,
updatedMessage,
signature
)
).to.be.revertedWith("Invalid relayer fee");

await expect(
spokePool
Expand Down