Skip to content

Instantly share code, notes, and snippets.

@mempirate
Created June 15, 2022 13:20
Show Gist options
  • Save mempirate/ee8e142017b3756c235ced9ecf49b2ff to your computer and use it in GitHub Desktop.
Save mempirate/ee8e142017b3756c235ced9ecf49b2ff to your computer and use it in GitHub Desktop.
start_time = format_date("02-01-2006 15:04", "01-02-2022 00:00")
end_time = now
loop {
items = ["ethereum", "polygon", "arbitrum", "optimism"]
query "erc4626_deposits" {
chain = item
event "Deposit" {
abi = "erc4626.abi.json"
outputs = ["caller", "owner", "assets", "shares"]
// This will revert if the contract does not have
// this method (required in the ERC4626 standard)
method "asset" {
outputs = ["asset"]
}
method "decimals" {
outputs = ["decimals"]
}
method "symbol" {
outputs = ["symbol"]
}
}
save {
block = blocknumber
time = timestamp
contract = contract_address
tx = tx_hash
// We need the chain to differentiate
// the results
chain = chain
underlying = asset
caller = caller
owner = owner
assets = parse_decimals(assets, decimals)
shares = parse_decimals(shares, decimals)
symbol = symbol
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment