Skip to content

Commit

Permalink
add fix for overflow tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlapham committed Aug 22, 2023
1 parent 701390c commit 3c6ef63
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "graph build",
"create-local": "graph create ianlapham/uniswap-v3 --node http://127.0.0.1:8020",
"deploy-local": "graph deploy ianlapham/uniswap-v3 --debug --ipfs http://localhost:5001 --node http://127.0.0.1:8020",
"deploy": "graph deploy ianlapham/optimism-post-regenesis --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --debug",
"deploy": "graph deploy ianlapham/uniswap-optmism-regen --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --debug",
"deploy-dev": "graph deploy sommelier/uniswap-v3 --ipfs http://35.197.14.14:5000/ --node http://35.197.14.14:8020/ --debug",
"deploy-staging": "graph deploy $THE_GRAPH_GITHUB_USER/$THE_GRAPH_SUBGRAPH_NAME /Uniswap --ipfs https://api.staging.thegraph.com/ipfs/ --node https://api.staging.thegraph.com/deploy/",
"watch-local": "graph deploy ianlapham/uniswap-v3 --watch --debug --node http://127.0.0.1:8020/ --ipfs http://localhost:5001"
Expand Down
12 changes: 12 additions & 0 deletions src/mappings/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ export function handlePoolCreated(event: PoolCreated): void {
return
}

// fix for pool overflow - this pool has a token that overflows on one of its values, but theres no way in
// assembly ts to error catch for this.
// Transaction - https://optimistic.etherscan.io/tx/0x16312a52237ce08e4bb7534648f4c8da6cd4c192f0b955cf6770b2d347f19d2b
if (
event.params.pool === Address.fromHexString('0x282b7d6bef6c78927f394330dca297eca2bd18cd')
|| event.params.pool === Address.fromHexString('0x5738de8d0b864d5ef5d65b9e05b421b71f2c2eb4')
|| event.params.pool === Address.fromHexString('0x5500721e5a063f0396c5e025a640e8491eb89aac')
|| event.params.pool === Address.fromHexString('0x1ffd370f9d01f75de2cc701956886acec9749e80')
) {
return
}

// load factory
let factory = Factory.load(FACTORY_ADDRESS)
if (factory === null) {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ERC20 } from '../types/Factory/ERC20'
import { ERC20SymbolBytes } from '../types/Factory/ERC20SymbolBytes'
import { ERC20NameBytes } from '../types/Factory/ERC20NameBytes'
import { StaticTokenDefinition } from './staticTokenDefinition'
import { BigInt, Address } from '@graphprotocol/graph-ts'
import { BigInt, Address, ByteArray } from '@graphprotocol/graph-ts'
import { isNullEthValue } from '.'

export function fetchTokenSymbol(tokenAddress: Address): string {
Expand Down Expand Up @@ -88,6 +88,7 @@ export function fetchTokenDecimals(tokenAddress: Address): BigInt {
}

let decimalResult = contract.try_decimals()

if (!decimalResult.reverted) {
decimalValue = decimalResult.value
}
Expand Down
4 changes: 2 additions & 2 deletions subgraph.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
specVersion: 0.0.2
description: Uniswap is a decentralized protocol for automated token exchange on Ethereum.
graft:
base: Qmf9i13TJknQwcamcLbb75hEhbf3nqDi321XWhtFBj3P5s
block: 10028767
base: QmSeJkpvWGcm9XceLc7qV9kKbc2pmo4xyfcfEd8GLgpVDw
block: 108380046
repository: https://github.com/Uniswap/uniswap-v3-subgraph
schema:
file: ./schema.graphql
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ asn1@~0.2.3:
dependencies:
safer-buffer "~2.1.0"

"assemblyscript@git+https://github.com/AssemblyScript/assemblyscript.git#36040d5b5312f19a025782b5e36663823494c2f3":
"assemblyscript@https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3":
version "0.6.0"
resolved "git+https://github.com/AssemblyScript/assemblyscript.git#36040d5b5312f19a025782b5e36663823494c2f3"
resolved "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3"
dependencies:
"@protobufjs/utf8" "^1.1.0"
binaryen "77.0.0-nightly.20190407"
Expand Down

0 comments on commit 3c6ef63

Please sign in to comment.