Skip to content

Fly 2075/add tests and tasks in foundry#369

Merged
Luisfc68 merged 39 commits into
lbc-splitfrom
FLY-2075/add-tests-and-tasks-in-foundry
Nov 20, 2025
Merged

Fly 2075/add tests and tasks in foundry#369
Luisfc68 merged 39 commits into
lbc-splitfrom
FLY-2075/add-tests-and-tasks-in-foundry

Conversation

@Hakob23

@Hakob23 Hakob23 commented Oct 28, 2025

Copy link
Copy Markdown
Collaborator

What

The task

@github-actions

github-actions Bot commented Oct 28, 2025

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

…des, including Makefile updates and new script for handling refunds
… including Makefile updates, new helper scripts for fetching Bitcoin transaction data, and a Foundry script for registering PegIn transactions.
…rade, and UpgradeLBC scripts, validating ownership transfer, deployment flow, and upgrade patterns for LiquidityBridgeContract.
…sh-quote, pause-system, refund-user-pegout, and register-pegin functionalities, enhancing modularity and maintainability. Remove obsolete bash scripts.
…ing Bitcoin addresses, and update references in Foundry tasks to use TypeScript instead of JavaScript. Additionally, update ESLint configuration to include new directories.
Comment thread forge-test/collateral/Configuration.t.sol Outdated
Comment thread forge-test/collateral/Configuration.t.sol Outdated
Comment thread forge-test/collateral/Resign.t.sol Outdated
Comment thread forge-scripts/tasks/HashQuote.s.sol
Comment thread forge-test/tasks/HashQuote.t.sol
Comment thread forge-test/pegout/LpRefund.t.sol
Comment thread forge-test/pegout/LpRefund.t.sol
Comment thread forge-test/pegout/LpRefund.t.sol
Comment thread forge-test/pegout/LpRefund.t.sol Outdated
Comment thread forge-test/legacy/PegIn.t.sol
@Hakob23 Hakob23 requested a review from Luisfc68 November 17, 2025 21:33

@Luisfc68 Luisfc68 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PR is almost done, just need a few minor fixes

console.log("Hash from contract:");
console.logBytes32(contractHash);

// The script uses the same contract method, so hashes should match

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The script still doesn't have any assertions

console.log("Hash from contract:");
console.logBytes32(contractHash);

// The script uses the same contract method, so hashes should match

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In this case is also pending

* @notice Test for the ChangeOwnerToMultiSig deployment script
* @dev Tests ownership transfer pattern to multisig
*/
contract ChangeOwnerToMultiSigTest is Test {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still pending, you could just try to setProviderStatus with the new owner


// Register by someone else (not LP) - LP gets penalized
vm.prank(registerCaller);
pegInContract.registerPegIn(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

still needs to verify the events


// Register should revert
vm.prank(fullLp);
vm.expectRevert(); // AmountTooLow from Quotes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

still pending

Comment thread forge-test/pegin/RegisterPegIn.t.sol Outdated
);
}

// Note: Reentrancy tests would require deploying malicious contracts that attempt

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

still pending

}

function test_HashPegOutQuote_HashesPegOutQuoteProperly() public view {
// Note: Like PegIn hashing tests, we verify determinism rather than exact hashes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can't you use an approach similar to the one used in the hash quote task to address this issue?

);
}

function test_RefundPegOut_RevertsIfNullDataScriptHasWrongSize() public {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test is correct and I'd leave it, but my comment was about the case where the null data script is correct in format but the quote hash it represents doesn't match the quote being refunded

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So a copy paste of this test with a diff OP_RETURN should work

@Luisfc68

Luisfc68 commented Nov 20, 2025

Copy link
Copy Markdown
Collaborator

I'm merging the PR to unblock depending PRs. The fixes can be addressed in a new one as they're minor

@Luisfc68 Luisfc68 merged commit fe35840 into lbc-split Nov 20, 2025
5 checks passed
@Luisfc68 Luisfc68 deleted the FLY-2075/add-tests-and-tasks-in-foundry branch November 20, 2025 18:04
@Luisfc68 Luisfc68 restored the FLY-2075/add-tests-and-tasks-in-foundry branch November 20, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants