From 4e65ab7ff0f85162c52ca9b34db6038b411fc1d7 Mon Sep 17 00:00:00 2001 From: Arthur Abeilice Date: Mon, 4 May 2026 21:20:24 -0300 Subject: [PATCH] chore(codegen): drop committed src/blockchain/abi.ts in favor of generated src/generated.ts The 58KB src/blockchain/abi.ts was the output of the legacy hardhat-based wagmi config and was being committed verbatim. Since wagmi.config.ts now emits src/generated.ts (gitignored, regenerated on every prestart via `bun run wagmi:gen`), keeping the old artifact in the tree was just dead weight. - Remove src/blockchain/abi.ts from tracking - Repoint 4 imports (sellerMethods, events, provider, BuyerSearchComponent) from `@/blockchain/abi` / `./abi` to `@/generated` - contracts:compile now injects ALCHEMY_API_KEY=placeholder + a default test MNEMONIC so hardhat.config.ts can load without a manual .env in the submodule (matches the placeholder values used in p2pix-front-end's submodule .env) --- package.json | 2 +- src/blockchain/abi.ts | 2266 ----------------- src/blockchain/events.ts | 2 +- src/blockchain/provider.ts | 2 +- src/blockchain/sellerMethods.ts | 2 +- .../BuyerSteps/BuyerSearchComponent.vue | 2 +- 6 files changed, 5 insertions(+), 2271 deletions(-) delete mode 100644 src/blockchain/abi.ts diff --git a/package.json b/package.json index 83007fa..dae8e5a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:fix": "eslint . --fix", "format": "prettier --write \"src/**/*.{ts,vue,json}\"", "format:check": "prettier --check \"src/**/*.{ts,vue,json}\"", - "contracts:compile": "cd p2pix-smart-contracts && bun install && bunx hardhat compile", + "contracts:compile": "cd p2pix-smart-contracts && bun install && ALCHEMY_API_KEY=placeholder MNEMONIC='test test test test test test test test test test test junk' bunx hardhat compile", "prewagmi:gen": "bun run contracts:compile", "wagmi:gen": "bun ./node_modules/@wagmi/cli/dist/esm/cli.js generate" }, diff --git a/src/blockchain/abi.ts b/src/blockchain/abi.ts deleted file mode 100644 index 657941e..0000000 --- a/src/blockchain/abi.ts +++ /dev/null @@ -1,2266 +0,0 @@ -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// BaseUtils -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const baseUtilsAbi = [ - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'Reentrancy' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, - { type: 'error', inputs: [], name: 'Unauthorized' }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'token', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'AllowedERC20Updated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'FundsWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', - indexed: true, - }, - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockBlocksUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReleased', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReturned', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'reputation', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'ReputationUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, - }, - ], - name: 'RootUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'forwarder', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'TrustedForwarderUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'ValidSet', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'signers', - internalType: 'address[]', - type: 'address[]', - indexed: false, - }, - ], - name: 'ValidSignersUpdated', - }, - { - type: 'function', - inputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - name: '_castAddrToKey', - outputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - name: '_castKeyToAddr', - outputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [ - { name: 'erc20', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'allowedERC20s', - outputs: [{ name: 'state', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'defaultLockBlocks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'str', internalType: 'string', type: 'string' }], - name: 'getStr', - outputs: [{ name: 'strEnc', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'reputation', - outputs: [ - { name: '', internalType: 'contract IReputation', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'sellerKey', internalType: 'address', type: 'address' }], - name: 'sellerAllowList', - outputs: [{ name: 'root', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '_blocks', internalType: 'uint256', type: 'uint256' }], - name: 'setDefaultLockBlocks', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { - name: '_reputation', - internalType: 'contract IReputation', - type: 'address', - }, - ], - name: 'setReputation', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'forwarders', internalType: 'address[]', type: 'address[]' }, - { name: 'states', internalType: 'bool[]', type: 'bool[]' }, - ], - name: 'setTrustedFowarders', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: '_validSigners', internalType: 'address[]', type: 'address[]' }, - ], - name: 'setValidSigners', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: '_tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: '_states', internalType: 'bool[]', type: 'bool[]' }, - ], - name: 'tokenSettings', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'message', internalType: 'bytes32', type: 'bytes32' }], - name: 'usedTransactions', - outputs: [{ name: 'used', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'signer', internalType: 'uint256', type: 'uint256' }], - name: 'validBacenSigners', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'withdrawBalance', - outputs: [], - stateMutability: 'nonpayable', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ECDSA -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const ecdsaAbi = [ - { type: 'error', inputs: [], name: 'InvalidSignature' }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ERC20 -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const erc20Abi = [ - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'spender', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Approval', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'to', internalType: 'address', type: 'address', indexed: true }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Transfer', - }, - { - type: 'function', - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, - ], - name: 'allowance', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'approve', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'decimals', - outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'name', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'nonces', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'deadline', internalType: 'uint256', type: 'uint256' }, - { name: 'v', internalType: 'uint8', type: 'uint8' }, - { name: 'r', internalType: 'bytes32', type: 'bytes32' }, - { name: 's', internalType: 'bytes32', type: 'bytes32' }, - ], - name: 'permit', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'symbol', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalSupply', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'transfer', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'transferFrom', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ERC2771Context -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const erc2771ContextAbi = [ - { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// EventAndErrors -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const eventAndErrorsAbi = [ - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'token', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'AllowedERC20Updated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'FundsWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', - indexed: true, - }, - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockBlocksUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReleased', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReturned', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'reputation', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'ReputationUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, - }, - ], - name: 'RootUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'forwarder', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'TrustedForwarderUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'ValidSet', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'signers', - internalType: 'address[]', - type: 'address[]', - indexed: false, - }, - ], - name: 'ValidSignersUpdated', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// IReputation -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const iReputationAbi = [ - { - type: 'function', - inputs: [{ name: '_userCredit', internalType: 'uint256', type: 'uint256' }], - name: 'limiter', - outputs: [ - { name: '_spendLimit', internalType: 'uint256', type: 'uint256' }, - ], - stateMutability: 'pure', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// MockToken -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const mockTokenAbi = [ - { - type: 'constructor', - inputs: [{ name: 'supply', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'nonpayable', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'spender', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Approval', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'to', internalType: 'address', type: 'address', indexed: true }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Transfer', - }, - { - type: 'function', - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, - ], - name: 'allowance', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'approve', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'decimals', - outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'to', internalType: 'address[]', type: 'address[]' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - ], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'name', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'nonces', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'deadline', internalType: 'uint256', type: 'uint256' }, - { name: 'v', internalType: 'uint8', type: 'uint8' }, - { name: 'r', internalType: 'bytes32', type: 'bytes32' }, - { name: 's', internalType: 'bytes32', type: 'bytes32' }, - ], - name: 'permit', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'symbol', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalSupply', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'transfer', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'transferFrom', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Multicall -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const multicallAbi = [ - { type: 'constructor', inputs: [], stateMutability: 'payable' }, - { - type: 'error', - inputs: [{ name: 'reason', internalType: 'string', type: 'string' }], - name: 'CallFailed', - }, - { - type: 'function', - inputs: [ - { - name: 'calls', - internalType: 'struct Multicall.Call[]', - type: 'tuple[]', - components: [ - { name: 'target', internalType: 'address', type: 'address' }, - { name: 'callData', internalType: 'bytes', type: 'bytes' }, - ], - }, - ], - name: 'mtc1', - outputs: [ - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'bytes[]', type: 'bytes[]' }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { - name: 'calls', - internalType: 'struct Multicall.Call[]', - type: 'tuple[]', - components: [ - { name: 'target', internalType: 'address', type: 'address' }, - { name: 'callData', internalType: 'bytes', type: 'bytes' }, - ], - }, - ], - name: 'mtc2', - outputs: [ - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'bytes32', type: 'bytes32' }, - { - name: '', - internalType: 'struct Multicall.Result[]', - type: 'tuple[]', - components: [ - { name: 'success', internalType: 'bool', type: 'bool' }, - { name: 'returnData', internalType: 'bytes', type: 'bytes' }, - ], - }, - ], - stateMutability: 'nonpayable', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Owned -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const ownedAbi = [ - { type: 'error', inputs: [], name: 'Unauthorized' }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerUpdated', - }, - { - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// OwnerSettings -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const ownerSettingsAbi = [ - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, - { type: 'error', inputs: [], name: 'Unauthorized' }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'token', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'AllowedERC20Updated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'FundsWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', - indexed: true, - }, - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockBlocksUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReleased', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReturned', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'reputation', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'ReputationUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, - }, - ], - name: 'RootUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'forwarder', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'TrustedForwarderUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'ValidSet', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'signers', - internalType: 'address[]', - type: 'address[]', - indexed: false, - }, - ], - name: 'ValidSignersUpdated', - }, - { - type: 'function', - inputs: [ - { name: 'erc20', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'allowedERC20s', - outputs: [{ name: 'state', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'defaultLockBlocks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'reputation', - outputs: [ - { name: '', internalType: 'contract IReputation', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'sellerKey', internalType: 'address', type: 'address' }], - name: 'sellerAllowList', - outputs: [{ name: 'root', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '_blocks', internalType: 'uint256', type: 'uint256' }], - name: 'setDefaultLockBlocks', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { - name: '_reputation', - internalType: 'contract IReputation', - type: 'address', - }, - ], - name: 'setReputation', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'forwarders', internalType: 'address[]', type: 'address[]' }, - { name: 'states', internalType: 'bool[]', type: 'bool[]' }, - ], - name: 'setTrustedFowarders', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: '_validSigners', internalType: 'address[]', type: 'address[]' }, - ], - name: 'setValidSigners', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: '_tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: '_states', internalType: 'bool[]', type: 'bool[]' }, - ], - name: 'tokenSettings', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'signer', internalType: 'uint256', type: 'uint256' }], - name: 'validBacenSigners', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'withdrawBalance', - outputs: [], - stateMutability: 'nonpayable', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// P2PIX -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const p2PixAbi = [ - { - type: 'constructor', - inputs: [ - { name: 'defaultBlocks', internalType: 'uint256', type: 'uint256' }, - { name: 'validSigners', internalType: 'address[]', type: 'address[]' }, - { name: '_reputation', internalType: 'address', type: 'address' }, - { name: 'tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: 'tokenStates', internalType: 'bool[]', type: 'bool[]' }, - ], - stateMutability: 'payable', - }, - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'Reentrancy' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, - { type: 'error', inputs: [], name: 'Unauthorized' }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'token', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'AllowedERC20Updated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'DepositWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'FundsWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', - indexed: true, - }, - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockBlocksUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReleased', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'buyer', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'LockReturned', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'reputation', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'ReputationUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, - }, - ], - name: 'RootUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'forwarder', - internalType: 'address', - type: 'address', - indexed: true, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, - ], - name: 'TrustedForwarderUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'seller', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'token', - internalType: 'contract ERC20', - type: 'address', - indexed: false, - }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'ValidSet', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'signers', - internalType: 'address[]', - type: 'address[]', - indexed: false, - }, - ], - name: 'ValidSignersUpdated', - }, - { - type: 'function', - inputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - name: '_castAddrToKey', - outputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - name: '_castKeyToAddr', - outputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [ - { name: 'erc20', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'allowedERC20s', - outputs: [{ name: 'state', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'defaultLockBlocks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'pixTarget', internalType: 'string', type: 'string' }, - { name: 'allowlistRoot', internalType: 'bytes32', type: 'bytes32' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'amount', internalType: 'uint96', type: 'uint96' }, - { name: 'valid', internalType: 'bool', type: 'bool' }, - ], - name: 'deposit', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'getBalance', - outputs: [{ name: 'bal', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'sellers', internalType: 'address[]', type: 'address[]' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'getBalances', - outputs: [{ name: '', internalType: 'uint256[]', type: 'uint256[]' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'ids', internalType: 'uint256[]', type: 'uint256[]' }], - name: 'getLocksStatus', - outputs: [ - { name: '', internalType: 'uint256[]', type: 'uint256[]' }, - { - name: '', - internalType: 'enum DataTypes.LockStatus[]', - type: 'uint8[]', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'getPixTarget', - outputs: [{ name: 'pixTarget', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'getPixTargetString', - outputs: [{ name: 'pixTarget', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'str', internalType: 'string', type: 'string' }], - name: 'getStr', - outputs: [{ name: 'strEnc', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'getValid', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'amount', internalType: 'uint80', type: 'uint80' }, - { name: 'merkleProof', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: 'expiredLocks', internalType: 'uint256[]', type: 'uint256[]' }, - ], - name: 'lock', - outputs: [{ name: 'lockID', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'lockCounter', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'mapLocks', - outputs: [ - { name: 'counter', internalType: 'uint256', type: 'uint256' }, - { name: 'expirationBlock', internalType: 'uint256', type: 'uint256' }, - { name: 'pixTarget', internalType: 'bytes32', type: 'bytes32' }, - { name: 'amount', internalType: 'uint80', type: 'uint80' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'buyerAddress', internalType: 'address', type: 'address' }, - { name: 'seller', internalType: 'address', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'lockID', internalType: 'uint256', type: 'uint256' }, - { name: 'pixTimestamp', internalType: 'bytes32', type: 'bytes32' }, - { name: 'signature', internalType: 'bytes', type: 'bytes' }, - ], - name: 'release', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'reputation', - outputs: [ - { name: '', internalType: 'contract IReputation', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'sellerKey', internalType: 'address', type: 'address' }], - name: 'sellerAllowList', - outputs: [{ name: 'root', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '_blocks', internalType: 'uint256', type: 'uint256' }], - name: 'setDefaultLockBlocks', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { - name: '_reputation', - internalType: 'contract IReputation', - type: 'address', - }, - ], - name: 'setReputation', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'addr', internalType: 'address', type: 'address' }, - { name: 'merkleroot', internalType: 'bytes32', type: 'bytes32' }, - ], - name: 'setRoot', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'forwarders', internalType: 'address[]', type: 'address[]' }, - { name: 'states', internalType: 'bool[]', type: 'bool[]' }, - ], - name: 'setTrustedFowarders', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: '_validSigners', internalType: 'address[]', type: 'address[]' }, - ], - name: 'setValidSigners', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'state', internalType: 'bool', type: 'bool' }, - ], - name: 'setValidState', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: '_tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: '_states', internalType: 'bool[]', type: 'bool[]' }, - ], - name: 'tokenSettings', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'lockIDs', internalType: 'uint256[]', type: 'uint256[]' }], - name: 'unlockExpired', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'message', internalType: 'bytes32', type: 'bytes32' }], - name: 'usedTransactions', - outputs: [{ name: 'used', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'userRecord', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'signer', internalType: 'uint256', type: 'uint256' }], - name: 'validBacenSigners', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - { name: 'expiredLocks', internalType: 'uint256[]', type: 'uint256[]' }, - ], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'withdrawBalance', - outputs: [], - stateMutability: 'nonpayable', - }, - { type: 'receive', stateMutability: 'payable' }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ReentrancyGuard -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const reentrancyGuardAbi = [ - { type: 'error', inputs: [], name: 'Reentrancy' }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Reputation -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const reputationAbi = [ - { type: 'constructor', inputs: [], stateMutability: 'payable' }, - { - type: 'function', - inputs: [{ name: '_userCredit', internalType: 'uint256', type: 'uint256' }], - name: 'limiter', - outputs: [ - { name: '_spendLimit', internalType: 'uint256', type: 'uint256' }, - ], - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [], - name: 'magicValue', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'maxLimit', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, -] as const; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// SafeTransferLib -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const safeTransferLibAbi = [ - { type: 'error', inputs: [], name: 'ETHTransferFailed' }, - { type: 'error', inputs: [], name: 'TransferFailed' }, - { type: 'error', inputs: [], name: 'TransferFromFailed' }, -] as const; diff --git a/src/blockchain/events.ts b/src/blockchain/events.ts index 9b8d19a..82f688f 100644 --- a/src/blockchain/events.ts +++ b/src/blockchain/events.ts @@ -3,7 +3,7 @@ import { formatEther, toHex, stringToHex } from 'viem'; import type { PublicClient, Address } from 'viem'; import { Networks } from '@/config/networks'; import { getContract } from './provider'; -import { p2PixAbi } from './abi'; +import { p2PixAbi } from '@/generated'; import type { ValidDeposit } from '@/model/ValidDeposit'; import type { NetworkConfig } from '@/model/NetworkEnum'; import type { UnreleasedLock } from '@/model/UnreleasedLock'; diff --git a/src/blockchain/provider.ts b/src/blockchain/provider.ts index 56a41a4..01d4caa 100644 --- a/src/blockchain/provider.ts +++ b/src/blockchain/provider.ts @@ -1,4 +1,4 @@ -import { p2PixAbi } from './abi'; +import { p2PixAbi } from '@/generated'; import { updateWalletStatus } from './wallet'; import { createPublicClient, diff --git a/src/blockchain/sellerMethods.ts b/src/blockchain/sellerMethods.ts index 8253a59..c4c5c39 100644 --- a/src/blockchain/sellerMethods.ts +++ b/src/blockchain/sellerMethods.ts @@ -1,6 +1,6 @@ import { getContract, getPublicClient, getWalletClient } from './provider'; import { parseEther, toHex, ChainContract } from 'viem'; -import { mockTokenAbi } from './abi'; +import { mockTokenAbi } from '@/generated'; import { useUser } from '@/composables/useUser'; import { createParticipant } from '@/utils/bbPay'; import type { Participant } from '@/utils/bbPay'; diff --git a/src/components/BuyerSteps/BuyerSearchComponent.vue b/src/components/BuyerSteps/BuyerSearchComponent.vue index a1d4680..5404a28 100644 --- a/src/components/BuyerSteps/BuyerSearchComponent.vue +++ b/src/components/BuyerSteps/BuyerSearchComponent.vue @@ -12,7 +12,7 @@ import { onClickOutside } from '@vueuse/core'; import { Networks } from '@/config/networks'; import { TokenEnum } from '@/model/NetworkEnum'; import { getContract } from '@/blockchain/provider'; -import { reputationAbi } from '@/blockchain/abi'; +import { reputationAbi } from '@/generated'; import { type Address } from 'viem'; // Store reference