- Remove executable permissions from configuration files (.editorconfig, .env.example, .gitignore) - Remove executable permissions from documentation files (README.md, LICENSE, SECURITY.md) - Remove executable permissions from web assets (HTML, CSS, JS files) - Remove executable permissions from data files (JSON, SQL, YAML, requirements.txt) - Remove executable permissions from source code files across all apps - Add executable permissions to Python
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);
|
|
}
|
|
}
|