- Restructure .env.example with security-focused documentation, service-specific environment file references, and AWS Secrets Manager integration - Update CLI tests workflow to single Python 3.13 version, add pytest-mock dependency, and consolidate test execution with coverage - Add comprehensive security validation to package publishing workflow with manual approval gates, secret scanning, and release
37 lines
1.0 KiB
Solidity
37 lines
1.0 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
import "forge-std/Test.sol";
|
|
import "../../contracts/EscrowService.sol";
|
|
|
|
contract EscrowServiceFuzzTest is Test {
|
|
EscrowService public escrow;
|
|
address public owner;
|
|
address public provider;
|
|
address payable public client;
|
|
|
|
function setUp() public {
|
|
owner = address(this);
|
|
provider = makeAddr("provider");
|
|
client = payable(makeAddr("client"));
|
|
escrow = new EscrowService();
|
|
}
|
|
|
|
function invariant_balanceInvariant() public {
|
|
assertEq(address(escrow).balance, 0, "Escrow should hold no stray ETH after operations");
|
|
}
|
|
|
|
function testFuzz_EscrowFlow(uint256 amount) public {
|
|
vm.assume(amount >= 0.01 ether && amount <= 100 ether);
|
|
vm.deal(client, amount + 1 ether);
|
|
|
|
vm.prank(client);
|
|
escrow.deposit{value: amount}(provider);
|
|
assertEq(escrow.getBalance(provider), amount);
|
|
|
|
vm.prank(owner);
|
|
escrow.release(provider, client);
|
|
assertEq(escrow.getBalance(provider), 0);
|
|
}
|
|
}
|