Skip to content

Commit

Permalink
fixup! refactor: mf-6329 rename $MATIC to $POL
Browse files Browse the repository at this point in the history
  • Loading branch information
swkatmask committed Oct 4, 2024
1 parent e115464 commit 89e7338
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NetworkPluginID } from '@masknet/shared-base'
import { useWeb3, useWeb3Connection } from '@masknet/web3-hooks-base'
import HappyRedPacketV4ABI from '@masknet/web3-contracts/abis/HappyRedPacketV4.json'
import { useWeb3, useWeb3Connection } from '@masknet/web3-hooks-base'

import { CREATE_LUCKY_DROP_TOPIC } from '@masknet/web3-providers'
import type { ChainId } from '@masknet/web3-shared-evm'
import { useQuery } from '@tanstack/react-query'

Expand All @@ -17,13 +18,10 @@ export function useRedpacketToken(chainId: ChainId, hash: string, enabled?: bool
enabled,
queryKey: ['redpacket', 'token', chainId, hash],
queryFn: async () => {
// CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256,bool,uint256)
const TOPIC = '0x86af556fd7cfab9462285ad44f2d5913527c539ff549f74731ca9997ca534018'

const receipt = await web3Conn.getTransactionReceipt(hash)
if (!receipt || !inputs) return null
if (!web3) return
const log = receipt.logs.find((x) => x.topics[0] === TOPIC)
const log = receipt.logs.find((x) => x.topics[0] === CREATE_LUCKY_DROP_TOPIC)
if (!log) return null

const result = web3.eth.abi.decodeLog(inputs, log.data, log?.topics)
Expand Down
1 change: 1 addition & 0 deletions packages/web3-providers/src/RedPacket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,4 @@ class RedPacketAPI implements RedPacketBaseAPI.Provider<ChainId, SchemaType> {
}
}
export const RedPacket = new RedPacketAPI()
export { CREATE_LUCKY_DROP_TOPIC } from './constants.js'
2 changes: 1 addition & 1 deletion packages/web3-providers/src/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export { Mirror } from './Mirror/index.js'
export { CryptoScamDB } from './CryptoScamDB/index.js'
export { Multicall } from './Multicall/index.js'
export { Lens } from './Lens/index.js'
export { RedPacket } from './RedPacket/index.js'
export { RedPacket, CREATE_LUCKY_DROP_TOPIC } from './RedPacket/index.js'
export { TheGraphRedPacket } from './TheGraph/index.js'
export { SimpleHashEVM, SimpleHashSolana, SPAM_SCORE } from './SimpleHash/index.js'
export { SnapshotSearch } from './Snapshot/index.js'
Expand Down

0 comments on commit 89e7338

Please sign in to comment.