UNPKG

@btc-vision/btc-runtime

Version:

Bitcoin L1 Smart Contract Runtime for OP_NET. Build decentralized applications on Bitcoin using AssemblyScript and WebAssembly. Fully audited.

63 lines (52 loc) 3.52 kB
// 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 = 0x5349f6de; // sha256("supportsInterface(bytes4)") export const INTERFACE_ID_ERC165: u32 = 0x0e2b7fe2; // 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("OP721Approval(address owner,address spender,uint256 tokenId,uint256 nonce,uint64 deadline)") export const OP721_APPROVAL_TYPE_HASH: u8[] = [ 0xb8, 0x6e, 0x99, 0xda, 0xc0, 0x47, 0x4b, 0x4a, 0x9f, 0xc3, 0x32, 0x3a, 0xd6, 0xed, 0x2f, 0x39, 0x55, 0xe7, 0xb8, 0x6d, 0xc6, 0x8c, 0x62, 0x42, 0x82, 0x1c, 0xbc, 0xac, 0xa2, 0xd8, 0x79, 0xde, ]; // sha256("OP721ApprovalForAll(address owner,address spender,bool approved,uint256 nonce,uint64 deadline)") export const OP721_APPROVAL_FOR_ALL_TYPE_HASH: u8[] = [ 0x4f, 0x48, 0x06, 0x5d, 0x9e, 0xf1, 0x45, 0x25, 0x6b, 0xf7, 0x7f, 0xd2, 0xe5, 0x8b, 0x79, 0xe6, 0xf6, 0x0c, 0xd0, 0xd3, 0x47, 0x70, 0x14, 0x32, 0x34, 0x50, 0xc9, 0x65, 0xb7, 0x4b, 0x80, 0xed, ]; // 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()"