// Contract addresses (configurable)
export const COUPON_ADDRESS = process.env.COUPON_ADDRESS || '0x0000000000000000000000000000000000000002';
export const COUPON_FACTORY_ADDRESS = process.env.COUPON_FACTORY_ADDRESS || '0x0000000000000000000000000000000000000001';
export const COMPLIANCE_ADDRESS = process.env.COMPLIANCE_ADDRESS || '0x0000000000000000000000000000000000000003';
export const SETTLEMENT_ADDRESS = process.env.SETTLEMENT_ADDRESS || '0x0000000000000000000000000000000000000004';

export const COUPON_ABI = [
  'function ownerOf(uint256 tokenId) view returns (address)',
  'function balanceOf(address owner) view returns (uint256)',
  'function tokenOfOwnerByIndex(address owner, uint256 index) view returns (uint256)',
  'function getConfig(uint256 tokenId) view returns (address issuer, uint256 faceValue, uint8 couponType, uint256 expiryDate, uint256 maxResaleCount, bool transferable)',
  'function getResaleCount(uint256 tokenId) view returns (uint256)',
  'function isRedeemed(uint256 tokenId) view returns (bool)',
  'event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)',
];

export const COUPON_FACTORY_ABI = [
  'function batchMint(uint8 couponType, uint256 faceValue, uint256 quantity, uint256 expiryDate, bool transferable, uint256 maxResaleCount) returns (uint256)',
  'function getBatchInfo(uint256 batchId) view returns (address issuer, uint256 startTokenId, uint256 quantity, uint8 couponType)',
  'function totalBatches() view returns (uint256)',
  'event CouponBatchMinted(uint256 indexed batchId, address indexed issuer, uint8 couponType, uint256 faceValue, uint256 quantity, uint256 startTokenId)',
];

export const COMPLIANCE_ABI = [
  'function isFrozen(address account) view returns (bool)',
  'function getKYCLevel(address account) view returns (uint8)',
  'function isOFACListed(address account) view returns (bool)',
];

export const SETTLEMENT_ABI = [
  'function executeSwap(uint256 tokenId, address buyer, address seller, uint256 price, address stablecoin)',
  'event SwapExecuted(uint256 indexed tokenId, address indexed buyer, address indexed seller, uint256 price)',
];
