Skip to content

Commit

Permalink
put all claims endpoints in their own interface file
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Oct 28, 2024
1 parent 3381898 commit 11c9dd1
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 258 deletions.
3 changes: 2 additions & 1 deletion src/TheCompact.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.27;

import { ITheCompact } from "./interfaces/ITheCompact.sol";
import { ITheCompactClaims } from "./interfaces/ITheCompactClaims.sol";
import { CompactCategory } from "./types/CompactCategory.sol";
import { Lock } from "./types/Lock.sol";
import { Scope } from "./types/Scope.sol";
Expand Down Expand Up @@ -125,7 +126,7 @@ import { MetadataRenderer } from "./lib/MetadataRenderer.sol";
* formation (and, if necessary, involuntary dissolution) of "resource locks."
* This contract has not yet been properly tested, audited, or reviewed.
*/
contract TheCompact is ITheCompact, ERC6909, Tstorish {
contract TheCompact is ITheCompact, ITheCompactClaims, ERC6909, Tstorish {
using HashLib for address;
using HashLib for bytes32;
using HashLib for uint256;
Expand Down
260 changes: 4 additions & 256 deletions src/interfaces/ITheCompact.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,9 @@ import { ResetPeriod } from "../types/ResetPeriod.sol";
import { Scope } from "../types/Scope.sol";
import { CompactCategory } from "../types/CompactCategory.sol";
import { ISignatureTransfer } from "permit2/src/interfaces/ISignatureTransfer.sol";
import {
BasicTransfer,
SplitTransfer,
BasicClaim,
QualifiedClaim,
ClaimWithWitness,
QualifiedClaimWithWitness,
SplitClaim,
SplitClaimWithWitness,
QualifiedSplitClaim,
QualifiedSplitClaimWithWitness
} from "../types/Claims.sol";

import {
BatchTransfer,
SplitBatchTransfer,
BatchClaim,
QualifiedBatchClaim,
BatchClaimWithWitness,
QualifiedBatchClaimWithWitness,
SplitBatchClaim,
SplitBatchClaimWithWitness,
QualifiedSplitBatchClaim,
QualifiedSplitBatchClaimWithWitness
} from "../types/BatchClaims.sol";

import {
MultichainClaim,
QualifiedMultichainClaim,
MultichainClaimWithWitness,
QualifiedMultichainClaimWithWitness,
SplitMultichainClaim,
SplitMultichainClaimWithWitness,
QualifiedSplitMultichainClaim,
QualifiedSplitMultichainClaimWithWitness,
ExogenousMultichainClaim,
ExogenousQualifiedMultichainClaim,
ExogenousMultichainClaimWithWitness,
ExogenousQualifiedMultichainClaimWithWitness,
ExogenousSplitMultichainClaim,
ExogenousSplitMultichainClaimWithWitness,
ExogenousQualifiedSplitMultichainClaim,
ExogenousQualifiedSplitMultichainClaimWithWitness
} from "../types/MultichainClaims.sol";

import {
BatchMultichainClaim,
QualifiedBatchMultichainClaim,
BatchMultichainClaimWithWitness,
QualifiedBatchMultichainClaimWithWitness,
SplitBatchMultichainClaim,
SplitBatchMultichainClaimWithWitness,
QualifiedSplitBatchMultichainClaim,
QualifiedSplitBatchMultichainClaimWithWitness,
ExogenousBatchMultichainClaim,
ExogenousQualifiedBatchMultichainClaim,
ExogenousBatchMultichainClaimWithWitness,
ExogenousQualifiedBatchMultichainClaimWithWitness,
ExogenousSplitBatchMultichainClaim,
ExogenousSplitBatchMultichainClaimWithWitness,
ExogenousQualifiedSplitBatchMultichainClaim,
ExogenousQualifiedSplitBatchMultichainClaimWithWitness
} from "../types/BatchMultichainClaims.sol";
import { BasicTransfer, SplitTransfer } from "../types/Claims.sol";

import { BatchTransfer, SplitBatchTransfer } from "../types/BatchClaims.sol";

/**
* @title The Compact
Expand All @@ -82,8 +22,8 @@ interface ITheCompact {
event Claim(address indexed sponsor, address indexed allocator, address indexed arbiter, bytes32 claimHash);
event ForcedWithdrawalEnabled(address indexed account, uint256 indexed id, uint256 withdrawableAt);
event ForcedWithdrawalDisabled(address indexed account, uint256 indexed id);
event AllocatorRegistered(uint96 allocatorId, address allocator);
event CompactRegistered(address indexed sponsor, bytes32 claimHash, bytes32 typehash);
event AllocatorRegistered(uint96 allocatorId, address allocator);

error InvalidToken(address token);
error Expired(uint256 expiration);
Expand Down Expand Up @@ -159,198 +99,6 @@ interface ITheCompact {

function allocatedWithdrawal(SplitBatchTransfer calldata withdrawal) external returns (bool);

function claim(BasicClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(BasicClaim calldata claimPayload) external returns (bool);

function claim(QualifiedClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedClaim calldata claimPayload) external returns (bool);

function claim(ClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedClaimWithWitness calldata claimPayload) external returns (bool);

function claim(SplitClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitClaim calldata claimPayload) external returns (bool);

function claim(QualifiedSplitClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitClaim calldata claimPayload) external returns (bool);

function claim(SplitClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedSplitClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitClaimWithWitness calldata claimPayload) external returns (bool);

function claim(BatchClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(BatchClaim calldata claimPayload) external returns (bool);

function claim(QualifiedBatchClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedBatchClaim calldata claimPayload) external returns (bool);

function claim(BatchClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(BatchClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedBatchClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedBatchClaimWithWitness calldata claimPayload) external returns (bool);

function claim(SplitBatchClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitBatchClaim calldata claimPayload) external returns (bool);

function claim(QualifiedSplitBatchClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitBatchClaim calldata claimPayload) external returns (bool);

function claim(SplitBatchClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitBatchClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedSplitBatchClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitBatchClaimWithWitness calldata claimPayload) external returns (bool);

function claim(MultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(MultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousMultichainClaim calldata claimPayload) external returns (bool);

function claim(QualifiedMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedMultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedMultichainClaim calldata claimPayload) external returns (bool);

function claim(MultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(MultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(SplitMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitMultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousSplitMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousSplitMultichainClaim calldata claimPayload) external returns (bool);

function claim(QualifiedSplitMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitMultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedSplitMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedSplitMultichainClaim calldata claimPayload) external returns (bool);

function claim(SplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousSplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousSplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedSplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedSplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedSplitMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(BatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(BatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousBatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousBatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(QualifiedBatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedBatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedBatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedBatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(BatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(BatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(SplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousSplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousSplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(QualifiedSplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedSplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedSplitBatchMultichainClaim calldata claimPayload) external returns (bool);

function claim(SplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(SplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousSplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousSplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(QualifiedSplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(QualifiedSplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claim(ExogenousQualifiedSplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function claimAndWithdraw(ExogenousQualifiedSplitBatchMultichainClaimWithWitness calldata claimPayload) external returns (bool);

function enableForcedWithdrawal(uint256 id) external returns (uint256 withdrawableAt);

function disableForcedWithdrawal(uint256 id) external returns (bool);
Expand Down
Loading

0 comments on commit 11c9dd1

Please sign in to comment.