Skip to content

Commit

Permalink
deal with forge fmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Oct 18, 2024
1 parent 4c9798b commit 08dcf7f
Show file tree
Hide file tree
Showing 13 changed files with 656 additions and 2,787 deletions.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ extra_output_files = ["irOptimized"]
# TODO: use default with everything but FunctionSpecializer (F)

[fmt]
line_length = 100
line_length = 200
tab_width = 4
bracket_spacing = true
871 changes: 171 additions & 700 deletions src/TheCompact.sol

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/interfaces/IAllocator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ pragma solidity ^0.8.27;

interface IAllocator {
// Called on standard transfers; must return this function selector.
function attest(address operator, address from, address to, uint256 id, uint256 amount)
external
returns (bytes4);
function attest(address operator, address from, address to, uint256 id, uint256 amount) external returns (bytes4);
}
61 changes: 11 additions & 50 deletions src/interfaces/ITheCompact.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,10 @@ import { ISignatureTransfer } from "permit2/src/interfaces/ISignatureTransfer.so
* This contract has not yet been properly tested, audited, or reviewed.
*/
interface ITheCompact {
event Deposit(
address indexed depositor,
address indexed recipient,
uint256 indexed id,
uint256 depositedAmount
);
event Claim(
address indexed sponsor,
address indexed allocator,
address indexed arbiter,
bytes32 claimHash
);
event Withdrawal(
address indexed account,
address indexed recipient,
uint256 indexed id,
uint256 withdrawnAmount
);
event ForcedWithdrawalEnabled(
address indexed account, uint256 indexed id, uint256 withdrawableAt
);
event Deposit(address indexed depositor, address indexed recipient, uint256 indexed id, uint256 depositedAmount);
event Claim(address indexed sponsor, address indexed allocator, address indexed arbiter, bytes32 claimHash);
event Withdrawal(address indexed account, address indexed recipient, uint256 indexed id, uint256 withdrawnAmount);
event ForcedWithdrawalEnabled(address indexed account, uint256 indexed id, uint256 withdrawableAt);
event ForcedWithdrawalDisabled(address indexed account, uint256 indexed id);
event AllocatorRegistered(uint96 allocatorId, address allocator);

Expand All @@ -46,28 +29,16 @@ interface ITheCompact {
error InvalidSignature();
error PrematureWithdrawal(uint256 id);
error ForcedWithdrawalAlreadyDisabled(address account, uint256 id);
error UnallocatedTransfer(
address operator, address from, address to, uint256 id, uint256 amount
);
error UnallocatedTransfer(address operator, address from, address to, uint256 id, uint256 amount);
error InvalidBatchAllocation();
error InvalidRegistrationProof(address allocator);
error InvalidBatchDepositStructure();
error AllocatedAmountExceeded(uint256 allocatedAmount, uint256 providedAmount);
error InvalidScope(uint256 id);

function deposit(address allocator, ResetPeriod resetPeriod, Scope scope, address recipient)
external
payable
returns (uint256 id);
function deposit(address allocator, ResetPeriod resetPeriod, Scope scope, address recipient) external payable returns (uint256 id);

function deposit(
address token,
address allocator,
ResetPeriod resetPeriod,
Scope scope,
uint256 amount,
address recipient
) external returns (uint256 id);
function deposit(address token, address allocator, ResetPeriod resetPeriod, Scope scope, uint256 amount, address recipient) external returns (uint256 id);

function deposit(
address depositor,
Expand Down Expand Up @@ -108,23 +79,13 @@ interface ITheCompact {

function disableForcedWithdrawal(uint256 id) external returns (bool);

function forcedWithdrawal(uint256 id, address recipient)
external
returns (uint256 withdrawnAmount);
function forcedWithdrawal(uint256 id, address recipient) external returns (uint256 withdrawnAmount);

function __register(address allocator, bytes calldata proof)
external
returns (uint96 allocatorId);
function __register(address allocator, bytes calldata proof) external returns (uint96 allocatorId);

function getForcedWithdrawalStatus(address account, uint256 id)
external
view
returns (ForcedWithdrawalStatus status, uint256 forcedWithdrawalAvailableAt);
function getForcedWithdrawalStatus(address account, uint256 id) external view returns (ForcedWithdrawalStatus status, uint256 forcedWithdrawalAvailableAt);

function getLockDetails(uint256 id)
external
view
returns (address token, address allocator, ResetPeriod resetPeriod, Scope scope);
function getLockDetails(uint256 id) external view returns (address token, address allocator, ResetPeriod resetPeriod, Scope scope);

function check(uint256 nonce, address allocator) external view returns (bool consumed);

Expand Down
6 changes: 1 addition & 5 deletions src/lib/ConsumerLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ library ConsumerLib {
}
}

function isConsumedBy(uint256 nonceToCheck, address account)
internal
view
returns (bool consumed)
{
function isConsumedBy(uint256 nonceToCheck, address account) internal view returns (bool consumed) {
assembly {
let freeMemoryPointer := mload(0x40)

Expand Down
Loading

0 comments on commit 08dcf7f

Please sign in to comment.