Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion abi/balancer-meta-pool-strategy.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,4 +847,4 @@
"stateMutability": "view",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/balancer-vault.json
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,4 @@
"stateMutability": "payable",
"type": "receive"
}
]
]
2 changes: 1 addition & 1 deletion abi/base-reward-pool-4626.json
Original file line number Diff line number Diff line change
Expand Up @@ -1233,4 +1233,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/base-reward-pool.json
Original file line number Diff line number Diff line change
Expand Up @@ -660,4 +660,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/chainlink-feed-registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -929,4 +929,4 @@
"stateMutability": "view",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/curve-lp-token.json
Original file line number Diff line number Diff line change
Expand Up @@ -1183,4 +1183,4 @@
}
]
}
]
]
2 changes: 1 addition & 1 deletion abi/eac-aggregator-proxy.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,4 @@
"stateMutability": "view",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/initializable-abstract-strategy.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,4 +529,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/lido.json
Original file line number Diff line number Diff line change
Expand Up @@ -1597,4 +1597,4 @@
"name": "ContractVersionSet",
"type": "event"
}
]
]
2 changes: 1 addition & 1 deletion abi/meta-stable-pool.json
Original file line number Diff line number Diff line change
Expand Up @@ -1434,4 +1434,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/oeth-oracle-router.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"stateMutability": "view",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/origin-lens.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,4 @@
"stateMutability": "view",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/otoken-vault.json
Original file line number Diff line number Diff line change
Expand Up @@ -985,4 +985,4 @@
"stateMutability": "view",
"type": "function"
}
]
]
2 changes: 1 addition & 1 deletion abi/sfrx-eth.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,4 +847,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
41 changes: 41 additions & 0 deletions src/abi/balancer-rate-provider.abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export const ABI_JSON = [
{
"type": "constructor",
"stateMutability": "undefined",
"payable": false,
"inputs": [
{
"type": "address",
"name": "_rocketTokenRETH"
}
]
},
{
"type": "function",
"name": "getRate",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [],
"outputs": [
{
"type": "uint256",
"name": ""
}
]
},
{
"type": "function",
"name": "rocketTokenRETH",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [],
"outputs": [
{
"type": "address",
"name": ""
}
]
}
]
25 changes: 25 additions & 0 deletions src/abi/balancer-rate-provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as ethers from 'ethers'
import {LogEvent, Func, ContractBase} from './abi.support'
import {ABI_JSON} from './balancer-rate-provider.abi'

export const abi = new ethers.Interface(ABI_JSON);

export const functions = {
getRate: new Func<[], {}, bigint>(
abi, '0x679aefce'
),
rocketTokenRETH: new Func<[], {}, string>(
abi, '0xdb5dacc9'
),
}

export class Contract extends ContractBase {

getRate(): Promise<bigint> {
return this.eth_call(functions.getRate, [])
}

rocketTokenRETH(): Promise<string> {
return this.eth_call(functions.rocketTokenRETH, [])
}
}
23 changes: 18 additions & 5 deletions src/post-processors/validate-oeth/validate-oeth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Entity, EntityClass } from '@subsquid/typeorm-store'
import assert from 'assert'
import { sortBy } from 'lodash'

import { OETHMorphoAave, OETHVault } from '../../model'
import { OETHMorphoAave, OETHVault, StrategyBalance } from '../../model'
import { Block, Context } from '../../processor'
import { jsonify } from '../../utils/jsonify'

Expand All @@ -19,6 +19,12 @@ export const process = async (ctx: Context) => {
OETHMorphoAave,
expectations.oethMorphoAave,
)
await validateExpectations(
ctx,
block,
StrategyBalance,
expectations.strategyBalances,
)
firstBlock = false
}
}
Expand Down Expand Up @@ -57,11 +63,12 @@ const validateExpectation = async <
const actual = await ctx.store.findOne(Class, {
where: { id: expectation.id },
})
assert(actual, 'Expected entity does not exist.')
expectation.timestamp = new Date(expectation.timestamp).toJSON()
assert.deepEqual(JSON.parse(jsonify(actual)), expectation)
}

const expectations: Record<string, any[]> = {
const expectations = {
oethVaults: sortBy(
[
{
Expand Down Expand Up @@ -100,7 +107,7 @@ const expectations: Record<string, any[]> = {
weth: '368830581327791252482',
frxETH: '0',
},
],
] as any[],
(v) => v.blockNumber,
),
oethMorphoAave: sortBy(
Expand All @@ -123,7 +130,13 @@ const expectations: Record<string, any[]> = {
blockNumber: 17479788,
weth: '103288680000000000000',
},
],
] as any[],
(v) => v.blockNumber,
),
}
strategyBalances: sortBy(
[
// Place verified strategy balances in here.
] as any[],
(v) => v.blockNumber,
),
} as const
Loading