Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #37 from Xavier59/master
Browse files Browse the repository at this point in the history
Fix xSushiBar bug with xSushiAge and subgraph codegen and build error
  • Loading branch information
matthewlilley authored Feb 22, 2021
2 parents 08aadd7 + 346f62a commit ee7afb2
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ export function transfer(event: TransferEvent): void {

user.xSushiAgeDestroyed = user.xSushiAgeDestroyed.plus(xSushiAgeDestroyed)

// remove xSushiAge
user.xSushiAge = user.xSushiAge.minus(xSushiAgeDestroyed);
// Update xSushi last
user.xSushi = user.xSushi.minus(value)

Expand Down
2 changes: 1 addition & 1 deletion src/exchange/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function getEthPrice(block: ethereum.Block = null): BigDecimal {
}

export function findEthPerToken(token: Token): BigDecimal {
if (token.id == WETH_ADDRESS) {
if (Address.fromString(token.id) == WETH_ADDRESS) {
return BIG_DECIMAL_ONE
}

Expand Down
6 changes: 3 additions & 3 deletions subgraphs/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ dataSources:
- User
abis:
- name: Bar
file: ../node_modules/@sushiswap/core/build/contracts/SushiBar.json
file: ../node_modules/@sushiswap/core/build/abi/SushiBar.json
- name: SushiToken
file: ../node_modules/@sushiswap/core/build/contracts/SushiToken.json
file: ../node_modules/@sushiswap/core/build/abi/SushiToken.json
- name: Pair
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Pair.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Pair.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: transfer
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/dexcandles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dataSources:
- Pair
abis:
- name: Factory
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Factory.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Factory.json
eventHandlers:
- event: PairCreated(indexed address,indexed address,address,uint256)
handler: handleNewPair
Expand All @@ -39,7 +39,7 @@ templates:
- Pair
abis:
- name: Pair
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Pair.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Pair.json
eventHandlers:
- event: Swap(indexed address,uint256,uint256,uint256,uint256,indexed address)
handler: handleSwap
12 changes: 6 additions & 6 deletions subgraphs/exchange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ dataSources:
- Factory
abis:
- name: Factory
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Factory.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Factory.json
- name: Pair
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Pair.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Pair.json
- name: SushiToken
file: ../node_modules/@sushiswap/core/build/contracts/SushiToken.json
file: ../node_modules/@sushiswap/core/build/abi/SushiToken.json
- name: ERC20
file: ../node_modules/@sushiswap/core/build/contracts/ERC20.json
file: ../node_modules/@sushiswap/core/build/abi/ERC20.json
- name: ERC20SymbolBytes
file: ../abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
Expand Down Expand Up @@ -59,9 +59,9 @@ templates:
- User
abis:
- name: Pair
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Pair.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Pair.json
- name: Factory
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Factory.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Factory.json
eventHandlers:
- event: Mint(indexed address,uint256,uint256)
handler: onMint
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/lockup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ dataSources:
- User
abis:
- name: MasterChef
file: ../node_modules/@sushiswap/core/build/contracts/MasterChef.json
file: ../node_modules/@sushiswap/core/build/abi/MasterChef.json
- name: Pair
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Pair.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Pair.json
eventHandlers:
- event: Deposit(indexed address,indexed uint256,uint256)
handler: deposit
Expand Down
6 changes: 3 additions & 3 deletions subgraphs/maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ dataSources:
- Serving
abis:
- name: Pair
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Pair.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Pair.json
- name: ERC20
file: ../node_modules/@sushiswap/core/build/contracts/ERC20.json
file: ../node_modules/@sushiswap/core/build/abi/ERC20.json
- name: Factory
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Factory.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Factory.json
eventHandlers:
- event: Swap(indexed address,uint256,uint256,uint256,uint256,indexed address)
handler: served
Expand Down
8 changes: 4 additions & 4 deletions subgraphs/masterchef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ dataSources:
- User
abis:
- name: MasterChef
file: ../node_modules/@sushiswap/core/build/contracts/MasterChef.json
file: ../node_modules/@sushiswap/core/build/abi/MasterChef.json
- name: Factory
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Factory.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Factory.json
- name: Pair
file: ../node_modules/@sushiswap/core/build/contracts/UniswapV2Pair.json
file: ../node_modules/@sushiswap/core/build/abi/UniswapV2Pair.json
- name: ERC20
file: ../node_modules/@sushiswap/core/build/contracts/ERC20.json
file: ../node_modules/@sushiswap/core/build/abi/ERC20.json
eventHandlers:
- event: Deposit(indexed address,indexed uint256,uint256)
handler: deposit
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/timelock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dataSources:
- Timelock
abis:
- name: Timelock
file: ../node_modules/@sushiswap/core/build/contracts/Timelock.json
file: ../node_modules/@sushiswap/core/build/abi/Timelock.json
eventHandlers:
- event: CancelTransaction(indexed bytes32,indexed address,uint256,string,bytes,uint256)
handler: canceledTransaction
Expand Down

0 comments on commit ee7afb2

Please sign in to comment.