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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
26 changes: 26 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[profile.default]
src = "contracts"
out = "artifacts"
libs = ["node_modules", "lib"]
remappings = [
"@across-protocol/=node_modules/@across-protocol/",
"@ensdomains/=node_modules/@ensdomains/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@gnosis.pm/=node_modules/@gnosis.pm/",
"@maticnetwork/=node_modules/@maticnetwork/",
"@matterlabs/=node_modules/@matterlabs/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@scroll-tech/=node_modules/@scroll-tech/",
"@uma/=node_modules/@uma/",
"@uniswap/=node_modules/@uniswap/",
"arb-bridge-eth/=node_modules/arb-bridge-eth/",
"arb-bridge-peripherals/=node_modules/arb-bridge-peripherals/",
"arbos-precompiles/=node_modules/arbos-precompiles/",
"base64-sol/=node_modules/base64-sol/",
"eth-gas-reporter/=node_modules/eth-gas-reporter/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"hardhat/=node_modules/hardhat/",
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to add the mappings for the @scroll/tech contracts.

It's an NPM package

Copy link
Member Author

Choose a reason for hiding this comment

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

done

]
via_ir = true

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
36 changes: 36 additions & 0 deletions test/SpokePool.Relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,42 @@ describe("SpokePool Relayer Logic", async function () {
)
).to.be.revertedWith("invalid signature");
});
it("validates ERC-1271 depositor contract signature", async function () {
// The MockERC1271 contract returns true for isValidSignature if the signature was signed by the contract's
// owner, so using the depositor's signature should succeed and using someone else's signature should fail.
const incorrectSignature = await getUpdatedUSSDepositSignature(
relayer, // not depositor
relayData.depositId,
relayData.originChainId,
updatedOutputAmount,
updatedRecipient,
updatedMessage
);
await expect(
spokePool
.connect(relayer)
.fillUSSRelayWithUpdatedDeposit(
{ ...relayData, depositor: erc1271.address },
consts.repaymentChainId,
updatedOutputAmount,
updatedRecipient,
updatedMessage,
incorrectSignature
)
).to.be.revertedWith("invalid signature");
await expect(
spokePool
.connect(relayer)
.fillUSSRelayWithUpdatedDeposit(
{ ...relayData, depositor: erc1271.address },
consts.repaymentChainId,
updatedOutputAmount,
updatedRecipient,
updatedMessage,
signature
)
).to.not.be.reverted;
});
it("cannot send updated fill after original fill", async function () {
await spokePool.connect(relayer).fillUSSRelay(relayData, consts.repaymentChainId);
await expect(
Expand Down