// onOP20Received(address,address,uint256,bytes)
export const ON_OP20_RECEIVED_SELECTOR: u32 = 0xd83e7dbc;

// sha256("OP20AllowanceIncrease(address owner,address spender,uint256 amount,uint256 nonce,uint64 deadline)")
export const ALLOWANCE_INCREASE_TYPE_HASH: u8[] = [
    0x7e, 0x88, 0x02, 0xf1, 0xfd, 0x23, 0xe1, 0x0e, 0x0d, 0xde, 0x3f, 0x00, 0xc0, 0xaa, 0x48, 0x15,
    0xd8, 0x85, 0xec, 0xd9, 0xcd, 0xa0, 0xdf, 0x56, 0xff, 0xa2, 0x5e, 0xcc, 0x70, 0x2d, 0x45, 0x8e,
];

// sha256("OP20AllowanceDecrease(address owner,address spender,uint256 amount,uint256 nonce,uint64 deadline)")
export const ALLOWANCE_DECREASE_TYPE_HASH: u8[] = [
    0x70, 0x87, 0x99, 0x34, 0x92, 0x1c, 0x2f, 0x48, 0x17, 0x78, 0x87, 0x89, 0x77, 0xd5, 0xb4, 0x5e,
    0x2a, 0x59, 0xda, 0x1d, 0x28, 0x22, 0x41, 0xc9, 0x3f, 0xf1, 0xba, 0x6a, 0xf0, 0x98, 0xfc, 0xd0,
];

// onOP721Received(address,address,uint256,bytes)
export const ON_OP721_RECEIVED_SELECTOR: u32 = 0xd83e7dbc;

// onOP1155Received(address,address,uint256,uint256,bytes)
export const ON_OP1155_RECEIVED_MAGIC: u32 = 0xcedc9fdf;

// onOP1155BatchReceived(address,address,uint256[],uint256[],bytes)
export const ON_OP1155_BATCH_RECEIVED_MAGIC: u32 = 0x5d95545f;

// Interface IDs
// balanceOf(address,uint256) -> 0x7ab6c0bc
// balanceOfBatch(address[],uint256[]) -> 0xed4db4b0
// safeTransferFrom(address,address,uint256,uint256,bytes) -> 0x0875aead
// safeBatchTransferFrom(address,address,uint256[],uint256[],bytes) -> 0x1917c486
// setApprovalForAll(address,bool) -> 0xd97fb4c0
// isApprovedForAll(address,address) -> 0x67da1fb2
export const INTERFACE_ID_OP1155: u32 = 0x383cb555;

// sha256("uri(uint256)")
export const INTERFACE_ID_OP1155_METADATA_URI: u32 = 0x31473f54;

// sha256("supportsInterface(bytes4)")
export const INTERFACE_ID_ERC165: u32 = 0x0e2b7fe2;

// OP1155Transfer(address from,address to,uint256 id,uint256 amount,uint256 nonce,uint64 deadline)
export const OP1155_TRANSFER_TYPE_HASH: u8[] = [
    0x5a, 0x64, 0x2c, 0xa2, 0xd8, 0xfd, 0xe9, 0xe1, 0x28, 0x87, 0x7c, 0xf5, 0x5d, 0x71, 0x96, 0xe3,
    0x3a, 0xd4, 0x4b, 0xb3, 0x4b, 0x0a, 0x8d, 0x85, 0x8d, 0xa8, 0x04, 0xbd, 0x3b, 0x86, 0x21, 0x0e,
];

// OP1155BatchTransfer(address from,address to,uint256[] ids,uint256[] amounts,uint256 nonce,uint64 deadline)
export const OP1155_BATCH_TRANSFER_TYPE_HASH: u8[] = [
    0x7b, 0xf8, 0xb6, 0x39, 0x5f, 0xea, 0xcc, 0x15, 0x97, 0x12, 0x38, 0x00, 0x91, 0xb9, 0x2b, 0x96,
    0x67, 0x6b, 0x2b, 0x73, 0x46, 0xff, 0x29, 0x27, 0xbf, 0x1a, 0x54, 0xf8, 0xfc, 0xef, 0x9c, 0x0b,
];

// sha256("OP712Domain(string name,string version,bytes32 chainId,bytes32 protocolId,address verifyingContract)")
export const OP712_DOMAIN_TYPE_HASH: u8[] = [
    0xfe, 0xe8, 0x22, 0x92, 0x35, 0x1d, 0x1a, 0x8b, 0xab, 0x21, 0xc4, 0xef, 0xdd, 0x15, 0x7e, 0x31,
    0x68, 0xe8, 0xf6, 0x32, 0x3a, 0xd0, 0x4c, 0xba, 0x12, 0xf7, 0x7c, 0x0b, 0xdc, 0x46, 0x22, 0x58,
];

// sha256("1")
export const OP712_VERSION_HASH: u8[] = [
    0x6b, 0x86, 0xb2, 0x73, 0xff, 0x34, 0xfc, 0xe1, 0x9d, 0x6b, 0x80, 0x4e, 0xff, 0x5a, 0x3f, 0x57,
    0x47, 0xad, 0xa4, 0xea, 0xa2, 0x2f, 0x1d, 0x49, 0xc0, 0x1e, 0x52, 0xdd, 0xb7, 0x87, 0x5b, 0x4b,
];

// sha256("OP721Approve(address owner,address spender,uint256 tokenId,uint256 nonce,uint64 deadline)")
export const OP721_APPROVE_TYPE_HASH: u8[] = [
    0x2e, 0x4b, 0x1b, 0xb9, 0x26, 0xd1, 0xfe, 0x9c, 0x56, 0x8a, 0xca, 0xc1, 0xb9, 0xfc, 0x8b, 0x98,
    0xf5, 0xfe, 0x67, 0xcb, 0x7b, 0x6d, 0x12, 0x03, 0x69, 0xaf, 0x3d, 0xb8, 0x44, 0x67, 0xb4, 0xcb,
];

// sha256("OP721Transfer(address from,address to,uint256 tokenId,uint256 nonce,uint64 deadline)")
export const OP721_TRANSFER_TYPE_HASH: u8[] = [
    0xf9, 0x03, 0xd7, 0xbe, 0x0c, 0xa4, 0x99, 0xee, 0x6d, 0x7d, 0x46, 0x22, 0xc7, 0x92, 0xb2, 0xea,
    0x64, 0xab, 0xa6, 0xaf, 0x68, 0x51, 0x03, 0xfe, 0xc4, 0xae, 0x12, 0xd7, 0xa6, 0xa9, 0xb2, 0x0f,
];

export const BALANCE_OF_SELECTOR:      u32 = 0x5b46f8f6; // "balanceOf(address)"
export const ALLOWANCE_SELECTOR:       u32 = 0xd864b7ca; // "allowance(address,address)"
export const TOTAL_SUPPLY_SELECTOR:    u32 = 0xa368022e; // "totalSupply()"
export const NAME_SELECTOR:            u32 = 0x1581f81c; // "name()"
export const SYMBOL_SELECTOR:          u32 = 0x25967ca5; // "symbol()"
export const DECIMALS_SELECTOR:        u32 = 0xbb844440; // "decimals()"
export const NONCE_OF_SELECTOR:        u32 = 0xf6824b65; // "nonceOf(address)"
export const DOMAIN_SEPARATOR_SELECTOR:u32 = 0xf1bf80e0; // "domainSeparator()"
export const METADATA_SELECTOR:        u32 = 0xfc0d115c; // "metadata()"
export const MAXIMUM_SUPPLY_SELECTOR:  u32 = 0x7d8d5019; // "maximumSupply()"
export const ICON_SELECTOR:            u32 = 0xaaaa50c5; // "icon()"
