Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv-chauhan committed Oct 29, 2024
1 parent 4f3da6f commit 1f0875d
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
"network": "arbitrum-one",
"file": "./src/mappings/handlers.ts",
"usdz": {
"address": "0x0000000000000000000000000000000000000000",
"startBlock": "244489246"
},
"childUsdz": {
"address": "0x5018609ab477cc502e170a5accf5312b86a4b94f",
"startBlock": "244489246"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"address": "0x04d5ddf5f3a8939889f11e97f8c4bb48317f1938",
"startBlock": "14531575"
},
"childUsdz": {
"address": "0x0000000000000000000000000000000000000000",
"startBlock": "14531575"
},
"graftEnabled": false,
"subgraphId": "",
"graftStartBlock": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
"network": "blast-mainnet",
"file": "./src/mappings/handlers.ts",
"usdz": {
"address": "0x0000000000000000000000000000000000000000",
"startBlock": "5504730"
},
"childUsdz": {
"address": "0x52056ed29fe015f4ba2e3b079d10c0b87f46e8c6",
"startBlock": "5504730"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"address": "0xa469b7ee9ee773642b3e93e842e5d9b5baa10067",
"startBlock": "19881600"
},
"childUsdz": {
"address": "0x0000000000000000000000000000000000000000",
"startBlock": "19881600"
},
"graftEnabled": false,
"subgraphId": "",
"graftStartBlock": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,73 +87,6 @@ dataSources:
handler: handleOFTSent
- event: OFTReceived(indexed bytes32,uint32,indexed address,uint256)
handler: handleOFTReceived
file: {{{ file }}}
- kind: ethereum
name: ChildUSDZ
network: {{ network }}
source:
address: "{{ childUsdz.address }}"
abi: ChildUSDZ
startBlock: {{ childUsdz.startBlock }}
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Token
- Pool
- PoolDailySnapshot
- PoolHourlySnapshot
- Protocol
- FinancialsDailySnapshot
- UsageMetricsDailySnapshot
- UsageMetricsHourlySnapshot
abis:
- name: USDZ
file: ./abis/AnzenV2/USDZ.json
- name: ChildUSDZ
file: ./abis/AnzenV2/ChildUSDZ.json

- name: ERC20
file: ./abis/Tokens/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/Tokens/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/Tokens/ERC20NameBytes.json

###########################################
############## Price Oracle ###############
###########################################
# ERC20
- name: _ERC20
file: ./abis/Prices/ERC20.json
# Curve Contracts
- name: CurvePool
file: ./abis/Prices/Curve/Pool.json
- name: CurveRegistry
file: ./abis/Prices/Curve/Registry.json
- name: CalculationsCurve
file: ./abis/Prices/Calculations/Curve.json
# YearnLens Contracts
- name: YearnLensContract
file: ./abis/Prices/YearnLens.json
# Aave Oracle Contract
- name: AaveOracleContract
file: ./abis/Prices/AaveOracle.json
# SushiSwap Contracts
- name: CalculationsSushiSwap
file: ./abis/Prices/Calculations/SushiSwap.json
# ChainLink Contracts
- name: ChainLinkContract
file: ./abis/Prices/ChainLink.json
# Uniswap Contracts
- name: UniswapRouter
file: ./abis/Prices/Uniswap/Router.json
- name: UniswapFactory
file: ./abis/Prices/Uniswap/Factory.json
- name: UniswapPair
file: ./abis/Prices/Uniswap/Pair.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
file: {{{ file }}}
14 changes: 5 additions & 9 deletions subgraphs/anzen-v2/src/mappings/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import {
RedeemFeeRateChanged,
OFTSent,
OFTReceived,
Transfer,
USDZ,
} from "../../generated/USDZ/USDZ";
import { Transfer } from "../../generated/ChildUSDZ/ChildUSDZ";
import { _ERC20 } from "../../generated/USDZ/_ERC20";
import { Token } from "../../generated/schema";

Expand Down Expand Up @@ -144,10 +144,6 @@ export function handleMint(event: Mint): void {
.times(feeRate.toBigDecimal())
.div(feeCoeff.toBigDecimal());
pool.addRevenueNative(token, BIGINT_ZERO, bigDecimalToBigInt(feeAmount));

const user = event.transaction.from;
const account = sdk.Accounts.loadAccount(user);
account.trackActivity();
}

export function handleMintFeeRateChanged(event: MintFeeRateChanged): void {
Expand Down Expand Up @@ -192,10 +188,6 @@ export function handleRedeem(event: Redeem): void {
.times(feeRate.toBigDecimal())
.div(feeCoeff.toBigDecimal());
pool.addRevenueNative(token, BIGINT_ZERO, bigDecimalToBigInt(feeAmount));

const user = event.transaction.from;
const account = sdk.Accounts.loadAccount(user);
account.trackActivity();
}

export function handleRedeemFeeRateChanged(event: RedeemFeeRateChanged): void {
Expand Down Expand Up @@ -232,6 +224,10 @@ export function handleOFTSent(event: OFTSent): void {
const contract = USDZ.bind(event.address);
const supply = contract.totalSupply();
pool.setInputTokenBalances([supply], true);

const user = event.transaction.from;
const account = sdk.Accounts.loadAccount(user);
account.trackActivity();
}

export function handleOFTReceived(event: OFTReceived): void {
Expand Down

0 comments on commit 1f0875d

Please sign in to comment.