Skip to content

Commit

Permalink
chore: remove duplicate abis
Browse files Browse the repository at this point in the history
  • Loading branch information
marthendalnunes committed Dec 5, 2024
1 parent a405722 commit 405ce0a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 758 deletions.
28 changes: 28 additions & 0 deletions packages/universal-data/src/delegation/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { type Address, type Hex, keccak256, toHex } from 'viem';

// Delegation constants
export const ANY_DELEGATE =
'0x0000000000000000000000000000000000000a11' as Address;
export const ROOT_AUTHORITY =
'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' as Hex;

// Execution Modes
export const BATCH_EXECUTION_MODE = [
'0x0100000000000000000000000000000000000000000000000000000000000000' as Hex,
];
export const SINGLE_EXECUTION_MODE = [
'0x0000000000000000000000000000000000000000000000000000000000000000' as Hex,
];
export const EMPTY_ARGS = '0x';
export const EMPTY_SIGNATURE = '0x';
export const SALT = BigInt(0);

export const CAVEAT_TYPEHASH = keccak256(
toHex('Caveat(address enforcer,bytes terms)'),
);

export const DELEGATION_TYPEHASH = keccak256(
toHex(
'Delegation(address delegate,address delegator,bytes32 authority,Caveat[] caveats,uint256 salt)Caveat(address enforcer,bytes terms)',
),
);
11 changes: 11 additions & 0 deletions packages/universal-data/src/exports/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ export type {
} from '../types.js';
export { findTokenBySymbol } from '../utils/find-token-by-symbol.js';
export { findToken } from '../utils/find-token.js';
export {
ANY_DELEGATE,
BATCH_EXECUTION_MODE,
CAVEAT_TYPEHASH,
DELEGATION_TYPEHASH,
EMPTY_ARGS,
EMPTY_SIGNATURE,
ROOT_AUTHORITY,
SALT,
SINGLE_EXECUTION_MODE,
} from '../delegation/constants.js';
Loading

0 comments on commit 405ce0a

Please sign in to comment.