diff --git a/packages/boba/subgraph/L2/abis/TuringMonsters.json b/packages/boba/subgraph/L2/abis/TuringMonsters.json new file mode 100644 index 0000000000..0a1cf1d9d8 --- /dev/null +++ b/packages/boba/subgraph/L2/abis/TuringMonsters.json @@ -0,0 +1,745 @@ +[ + { + "type": "constructor", + "stateMutability": "nonpayable", + "inputs": [ + { + "type": "string", + "name": "name_", + "internalType": "string" + }, + { + "type": "string", + "name": "symbol_", + "internalType": "string" + }, + { + "type": "uint256", + "name": "maxNFTs_", + "internalType": "uint256" + }, + { + "type": "address[]", + "name": "creatorAddresses_", + "internalType": "address[]" + }, + { + "type": "address", + "name": "turingHelperAddress_", + "internalType": "address" + } + ] + }, + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "approved", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ApprovalForAll", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "operator", + "internalType": "address", + "indexed": true + }, + { + "type": "bool", + "name": "approved", + "internalType": "bool", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MintedNFT", + "inputs": [ + { + "type": "uint256", + "name": "id", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "type": "address", + "name": "previousOwner", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "newOwner", + "internalType": "address", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Paused", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "to", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Unpaused", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "MAX_MINT_IN_PUBLIC", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "PRICE", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "ROYALTY_PERCENTAGE", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "amountMintedInPublicSale", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "approve", + "inputs": [ + { + "type": "address", + "name": "to", + "internalType": "address" + }, + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "availableTokenCount", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "balanceOf", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bytes", + "name": "", + "internalType": "bytes" + } + ], + "name": "bridgeExtraData", + "inputs": [ + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "burn", + "inputs": [ + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "exists", + "inputs": [ + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "getApproved", + "inputs": [ + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "isApprovedForAll", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address" + }, + { + "type": "address", + "name": "operator", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "payable", + "outputs": [], + "name": "mint", + "inputs": [ + { + "type": "uint256", + "name": "_count", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "string", + "name": "", + "internalType": "string" + } + ], + "name": "name", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "owner", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "ownerOf", + "inputs": [ + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "paused", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "pure", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "price", + "inputs": [ + { + "type": "uint256", + "name": "_count", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "projectOwners", + "inputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "recoverERC20", + "inputs": [ + { + "type": "address", + "name": "tokenAddress", + "internalType": "address" + }, + { + "type": "uint256", + "name": "tokenAmount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "recoverERC721", + "inputs": [ + { + "type": "address", + "name": "tokenAddress", + "internalType": "address" + }, + { + "type": "uint256", + "name": "tokenId_", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "renounceOwnership", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "receiver", + "internalType": "address" + }, + { + "type": "uint256", + "name": "royaltyAmount", + "internalType": "uint256" + } + ], + "name": "royaltyInfo", + "inputs": [ + { + "type": "uint256", + "name": "_tokenId", + "internalType": "uint256" + }, + { + "type": "uint256", + "name": "_salePrice", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "safeTransferFrom", + "inputs": [ + { + "type": "address", + "name": "from", + "internalType": "address" + }, + { + "type": "address", + "name": "to", + "internalType": "address" + }, + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "safeTransferFrom", + "inputs": [ + { + "type": "address", + "name": "from", + "internalType": "address" + }, + { + "type": "address", + "name": "to", + "internalType": "address" + }, + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + }, + { + "type": "bytes", + "name": "_data", + "internalType": "bytes" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "setApprovalForAll", + "inputs": [ + { + "type": "address", + "name": "operator", + "internalType": "address" + }, + { + "type": "bool", + "name": "approved", + "internalType": "bool" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "startTrading", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "supportsInterface", + "inputs": [ + { + "type": "bytes4", + "name": "_interfaceId", + "internalType": "bytes4" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "string", + "name": "", + "internalType": "string" + } + ], + "name": "symbol", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "tokenCount", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "string", + "name": "", + "internalType": "string" + } + ], + "name": "tokenURI", + "inputs": [ + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "totalSupply", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "transferFrom", + "inputs": [ + { + "type": "address", + "name": "from", + "internalType": "address" + }, + { + "type": "address", + "name": "to", + "internalType": "address" + }, + { + "type": "uint256", + "name": "tokenId", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "transferOwnership", + "inputs": [ + { + "type": "address", + "name": "newOwner", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "withdraw", + "inputs": [] + } +] diff --git a/packages/boba/subgraph/L2/config/mainnet.json b/packages/boba/subgraph/L2/config/mainnet.json index 7f34ee784b..aa292332f8 100644 --- a/packages/boba/subgraph/L2/config/mainnet.json +++ b/packages/boba/subgraph/L2/config/mainnet.json @@ -12,6 +12,9 @@ }, "Boba_GasPriceOracle": { "address": "0xeE06ee2F239d2ab11792D77f3C347d919ddA0d51" + }, + "TuringMonsters": { + "address": "0xce458FC7cfC322cDd65eC77Cf7B6410002E2D793" } } } diff --git a/packages/boba/subgraph/L2/config/rinkeby.json b/packages/boba/subgraph/L2/config/rinkeby.json index 618d51399c..84f6c1852a 100644 --- a/packages/boba/subgraph/L2/config/rinkeby.json +++ b/packages/boba/subgraph/L2/config/rinkeby.json @@ -12,6 +12,9 @@ }, "Boba_GasPriceOracle": { "address": "0x7F974A09a251dEA6b75af3e0A0e29D1133DaCf4b" + }, + "TuringMonsters": { + "address": "0x757b8E819d91659844E44F2141402831B60Fa4EE" } } } diff --git a/packages/boba/subgraph/L2/schema.graphql b/packages/boba/subgraph/L2/schema.graphql index 1baae7eabf..34478bd118 100644 --- a/packages/boba/subgraph/L2/schema.graphql +++ b/packages/boba/subgraph/L2/schema.graphql @@ -164,3 +164,10 @@ type UseETHAsFeeTokenEvent @entity { id: ID! address: Bytes } + +type TuringMonstersTransferEvent @entity { + id: ID! + from: Bytes + to: Bytes + tokenId: String +} diff --git a/packages/boba/subgraph/L2/src/TuringMonstersMapping.ts b/packages/boba/subgraph/L2/src/TuringMonstersMapping.ts new file mode 100644 index 0000000000..b389757371 --- /dev/null +++ b/packages/boba/subgraph/L2/src/TuringMonstersMapping.ts @@ -0,0 +1,12 @@ +import { Transfer } from '../generated/TuringMonsters/TuringMonsters' +import { TuringMonstersTransferEvent } from '../generated/schema' + +export function handleTuringMonstersTransferEvent(event: Transfer): void { + let id = event.transaction.hash.toHex() + let eventObj = new TuringMonstersTransferEvent(id) + eventObj.id = id + eventObj.from = event.params.from + eventObj.to = event.params.to + eventObj.tokenId = event.params.tokenId.toString() + eventObj.save() +} diff --git a/packages/boba/subgraph/L2/subgraph.template.yaml b/packages/boba/subgraph/L2/subgraph.template.yaml index 3183fe94d5..5e8cd07efc 100644 --- a/packages/boba/subgraph/L2/subgraph.template.yaml +++ b/packages/boba/subgraph/L2/subgraph.template.yaml @@ -122,3 +122,24 @@ dataSources: - event: UseETHAsFeeToken(address) handler: handleUseETHAsFeeToken file: ./src/Boba_GasPriceOracleMapping.ts + + + - kind: ethereum/contract + name: TuringMonsters + network: {{network}} + source: + address: '{{contracts.TuringMonsters.address}}' + abi: TuringMonsters + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - TuringMonsters + abis: + - name: TuringMonsters + file: ./abis/TuringMonsters.json + eventHandlers: + - event: Transfer(indexed address,indexed address,indexed uint256) + handler: handleTuringMonstersTransferEvent + file: ./src/TuringMonstersMapping.ts diff --git a/packages/boba/subgraph/L2/subgraph.yaml b/packages/boba/subgraph/L2/subgraph.yaml index 4a905e01a9..bca641a77b 100644 --- a/packages/boba/subgraph/L2/subgraph.yaml +++ b/packages/boba/subgraph/L2/subgraph.yaml @@ -9,7 +9,7 @@ dataSources: network: boba source: - address: '0x3A92cA39476fF84Dc579C868D4D7dE125513B034' + address: '0x8d3866a79aA780BA3DC1a300a1567635F3754a0e' abi: L2LiquidityPool mapping: kind: ethereum/events @@ -63,7 +63,7 @@ dataSources: name: GovernorBravoDelegate network: boba source: - address: '0x2CC555B5B1a4Cf7fA5401B29ab46fc5ba2e205b0' + address: '0x472e5C097C790c6a44366a89a987Ec996A4d83e0' abi: GovernorBravoDelegate mapping: kind: ethereum/events @@ -103,7 +103,7 @@ dataSources: name: Boba_GasPriceOracle network: boba source: - address: '0xeE06ee2F239d2ab11792D77f3C347d919ddA0d51' + address: '0x7F974A09a251dEA6b75af3e0A0e29D1133DaCf4b' abi: Boba_GasPriceOracle mapping: kind: ethereum/events @@ -122,3 +122,24 @@ dataSources: - event: UseETHAsFeeToken(address) handler: handleUseETHAsFeeToken file: ./src/Boba_GasPriceOracleMapping.ts + + + - kind: ethereum/contract + name: TuringMonsters + network: boba + source: + address: '0x757b8E819d91659844E44F2141402831B60Fa4EE' + abi: TuringMonsters + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - TuringMonsters + abis: + - name: TuringMonsters + file: ./abis/TuringMonsters.json + eventHandlers: + - event: Transfer(indexed address,indexed address,indexed uint256) + handler: handleTuringMonstersTransferEvent + file: ./src/TuringMonstersMapping.ts