chore(security): enhance environment configuration, CI workflows, and wallet daemon with security improvements
- 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
This commit is contained in:
36
contracts/test/fuzz/EscrowService.t.sol
Normal file
36
contracts/test/fuzz/EscrowService.t.sol
Normal file
@@ -0,0 +1,36 @@
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user