Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamped contract for escrow #12

Merged
merged 29 commits into from
Jul 15, 2024
Merged

Revamped contract for escrow #12

merged 29 commits into from
Jul 15, 2024

Conversation

GabrielCartier
Copy link
Contributor

No description provided.

Copy link

Coverage after merging feature/escrow into main will be

73.87%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Admin.sol100%100%100%100%
   Banker.sol100%100%100%100%
   Echo.sol100%100%100%100%
   EchoState.sol77.78%70%100%77.78%30–31, 31, 57–58, 58, 62–63, 63, 71–72, 72, 79–80, 80, 87–88, 88
src/escrow
   Escrow.sol100%100%100%100%
   EscrowHandler.sol100%100%100%100%
src/wormhole
   WormholeGovernance.sol0%0%0%0%100, 100, 12, 12, 12, 12, 12–13, 13, 15, 15, 15, 15–16, 16, 18, 18, 18, 18–19, 19, 21, 21–22, 22–23, 23, 96, 96, 96–97, 97, 97, 99, 99, 99, 99
   WormholeState.sol0%0%0%0%33, 33, 37, 37, 37, 41, 41, 54, 54, 54, 54–55, 55, 57, 57, 57, 57, 57–58, 58, 61, 61, 65, 65, 69, 69, 69

Copy link

Coverage after merging feature/escrow into main will be

77.57%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Admin.sol100%100%100%100%
   Banker.sol100%100%100%100%
   Echo.sol100%100%100%100%
   EchoState.sol95.65%93.75%100%95.65%89–90, 90
src/escrow
   Escrow.sol100%100%100%100%
   EscrowHandler.sol100%100%100%100%
src/wormhole
   WormholeGovernance.sol0%0%0%0%100, 100, 12, 12, 12, 12, 12–13, 13, 15, 15, 15, 15–16, 16, 18, 18, 18, 18–19, 19, 21, 21–22, 22–23, 23, 96, 96, 96–97, 97, 97, 99, 99, 99, 99
   WormholeState.sol0%0%0%0%33, 33, 37, 37, 37, 41, 41, 54, 54, 54, 54–55, 55, 57, 57, 57, 57, 57–58, 58, 61, 61, 65, 65, 69, 69, 69

Comment on lines +64 to +66
function _consumeMessage(bytes32 hash) internal {
_state.consumedMessages[hash] = true;
}

Check warning

Code scanning / Slither

Dead-code Warning

WormholeState._consumeMessage(bytes32) is never used and should be removed
Comment on lines +68 to +70
function _verifyEmitter(IWormhole.VM memory vm) internal view returns (bool) {
return _state.registeredEmitters[vm.emitterChainId] == vm.emitterAddress;
}

Check warning

Code scanning / Slither

Dead-code Warning

WormholeState._verifyEmitter(IWormhole.VM) is never used and should be removed
src/Echo.sol Fixed Show fixed Hide fixed
src/Echo.sol Fixed Show fixed Hide fixed
src/Echo.sol Fixed Show fixed Hide fixed
src/Echo.sol Fixed Show fixed Hide fixed
src/Admin.sol Dismissed Show dismissed Hide dismissed
src/Echo.sol Fixed Show fixed Hide fixed
Copy link

Coverage after merging feature/escrow into main will be

78.10%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Admin.sol100%100%100%100%
   Banker.sol100%100%100%100%
   Echo.sol100%100%100%100%
   EchoState.sol100%100%100%100%
src/escrow
   Escrow.sol100%100%100%100%
   EscrowHandler.sol100%100%100%100%
src/wormhole
   WormholeGovernance.sol0%0%0%0%100, 100, 12, 12, 12, 12, 12–13, 13, 15, 15, 15, 15–16, 16, 18, 18, 18, 18–19, 19, 21, 21–22, 22–23, 23, 96, 96, 96–97, 97, 97, 99, 99, 99, 99
   WormholeState.sol0%0%0%0%33, 33, 37, 37, 37, 41, 41, 54, 54, 54, 54–55, 55, 57, 57, 57, 57, 57–58, 58, 61, 61, 65, 65, 69, 69, 69

Copy link

Coverage after merging feature/escrow into main will be

78.10%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Admin.sol100%100%100%100%
   Banker.sol100%100%100%100%
   Echo.sol100%100%100%100%
   EchoState.sol100%100%100%100%
src/escrow
   Escrow.sol100%100%100%100%
   EscrowHandler.sol100%100%100%100%
src/wormhole
   WormholeGovernance.sol0%0%0%0%100, 100, 12, 12, 12, 12, 12–13, 13, 15, 15, 15, 15–16, 16, 18, 18, 18, 18–19, 19, 21, 21–22, 22–23, 23, 96, 96, 96–97, 97, 97, 99, 99, 99, 99
   WormholeState.sol0%0%0%0%33, 33, 37, 37, 37, 41, 41, 54, 54, 54, 54–55, 55, 57, 57, 57, 57, 57–58, 58, 61, 61, 65, 65, 69, 69, 69

Copy link

Coverage after merging feature/escrow into main will be

78.90%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Admin.sol100%100%100%100%
   Banker.sol100%100%100%100%
   Echo.sol100%100%100%100%
   EchoState.sol100%100%100%100%
src/escrow
   Escrow.sol100%100%100%100%
   EscrowHandler.sol100%100%100%100%
src/wormhole
   WormholeGovernance.sol0%0%0%0%100, 100, 12, 12, 12, 12, 12–13, 13, 15, 15, 15, 15–16, 16, 18, 18, 18, 18–19, 19, 21, 21–22, 22–23, 23, 96, 96, 96–97, 97, 97, 99, 99, 99, 99
   WormholeState.sol0%0%0%0%33, 33, 37, 37, 37, 41, 41, 54, 54, 54, 54–55, 55, 57, 57, 57, 57, 57–58, 58, 61, 61, 65, 65, 69, 69, 69

src/Echo.sol Outdated
event OfferExecuted(bytes32 indexed offerId);
// @dev For future use...

uint16 private immutable CHAIN_ID;

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

Variable Echo.CHAIN_ID is not in mixedCase
Publishing on blast now works
Added a few more scripts
Fixed the chain id bug
assertOfferItemsEq(offer1.receiverItems, offer2.receiverItems);
assertEq(uint256(offer1.state), uint256(offer2.state));
assertEq(offer1.expiration, offer2.expiration);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

following my comments on the first PR, I'd add an "assertOfferState` function

Added blast specific data on contract
Copy link

Coverage after merging feature/escrow into main will be

73.11%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Admin.sol100%100%100%100%
   Banker.sol100%100%100%100%
   Echo.sol100%100%100%100%
   EchoBlast.sol0%100%0%0%12–14, 18
   EchoState.sol100%100%100%100%
src/escrow
   Escrow.sol100%100%100%100%
   EscrowHandler.sol100%100%100%100%
src/wormhole
   WormholeGovernance.sol0%0%0%0%100, 12, 12, 12–13, 15, 15, 15–16, 18, 18, 18–19, 21–23, 96–97, 99, 99, 99
   WormholeState.sol0%0%0%0%33, 37, 41, 54, 54, 54–55, 57, 57, 57–58, 61, 65, 69
test/mock
   YieldMock.sol0%0%0%0%10, 10, 10, 12–13, 17, 21

Comment on lines +17 to +19
function claimGas() external onlyOwner {
BLAST.claimMaxGas(address(this), msg.sender);
}

Check warning

Code scanning / Slither

Unused return Medium

src/Echo.sol Dismissed Show dismissed Hide dismissed
@GabrielCartier GabrielCartier merged commit 4dbf7b0 into main Jul 15, 2024
3 checks passed
@GabrielCartier GabrielCartier deleted the feature/escrow branch July 15, 2024 21:31
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