Skip to content

Commit

Permalink
Remove EvmAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Mar 20, 2024
1 parent 7bedff7 commit 7f7f9d6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
subgraph.template.yaml
subgraph.template.yaml
src/config.template.ts
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"create-local": "graph create beefyfinance/beefy-cl --node http://127.0.0.1:8020",
"deploy-local": "graph deploy beefyfinance/beefy-cl --node http://127.0.0.1:8020 --ipfs http://localhost:5001",
"remove-local": "graph remove beefyfinance/beefy-cl --node http://127.0.0.1:8020",
"deploy:all": "yarn --silent prepare:arbitrum && yarn --silent deploy:arbitrum && yarn --silent prepare:optimism && yarn --silent deploy:optimism",
"prepare:arbitrum": "mustache config/arbitrum.json subgraph.template.yaml > subgraph.yaml && mustache config/arbitrum.json src/config.template.ts > src/config.ts ",
"prepare:optimism": "mustache config/optimism.json subgraph.template.yaml > subgraph.yaml && mustache config/optimism.json src/config.template.ts > src/config.ts ",
"deploy:arbitrum": "0xgraph remove beefyfinance/clm-arbitrum && sleep 10 && 0xgraph create beefyfinance/clm-arbitrum && yarn --silent codegen && 0xgraph build && sleep 5 && 0xgraph deploy beefyfinance/clm-arbitrum --version-label=v0.0.1",
Expand Down
21 changes: 6 additions & 15 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
##### Common dimensions ##########
##################################

"""
This is a generic interface that represents an Ethereum address.
It allows to make queries that are not specific to a particular type of address.
"""
interface EvmAddress {
"The account or contract address"
id: Bytes!
}

"""
A token is a representation of a fungible asset on the blockchain
as specified by the ERC20 standard.
Expand Down Expand Up @@ -40,8 +31,8 @@ type Transaction @entity(immutable: true) {
"The timestamp of the block the transaction was included in"
blockTimestamp: BigInt!

"The sender of the transaction"
sender: EvmAddress!
"The address of the sender of the transaction"
sender: Bytes!

"Gas fee paid for the transaction in the native token"
gasFee: BigDecimal!
Expand Down Expand Up @@ -228,7 +219,7 @@ enum VaultLifecycle {
PAUSED
}

type BeefyCLVault implements EvmAddress @entity {
type BeefyCLVault @entity {
"The vault address"
id: Bytes!

Expand Down Expand Up @@ -419,7 +410,7 @@ type BeefyCLVaultSnapshot implements Snapshot @entity {
A strategy is a contract that manages the assets of a vault.
This is mostly used to start tracking the events and link them to the vault on new event
"""
type BeefyCLStrategy implements EvmAddress @entity {
type BeefyCLStrategy @entity {
"The strategy address"
id: Bytes!

Expand Down Expand Up @@ -477,7 +468,7 @@ A vault incentive is a reward given to the investors of a vault.
The reward is given in a dedicated incentive token during a set period of time.
This is most commonly referred to as a "boost".
"""
type BeefyVaultIncentive implements EvmAddress @entity {
type BeefyVaultIncentive @entity {
"The inventive contract address"
id: Bytes!

Expand Down Expand Up @@ -527,7 +518,7 @@ type BeefyVaultIncentiveClaimEvent @entity(immutable: true) {
##### Investor Position ####
############################

type Investor implements EvmAddress @entity {
type Investor @entity {
"The investor address"
id: Bytes!

Expand Down
1 change: 1 addition & 0 deletions src/config.template.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Address, BigInt } from "@graphprotocol/graph-ts"

export const NETWORK_NAME = "{{network}}"
export const UNISWAP_V3_QUOTER_V2_ADDRESS = Address.fromString("{{uniswapV3QuoterV2Address}}")
export const WNATIVE_DECIMALS = BigInt.fromU32({{wrappedNativeDecimals}})
export const CHAINLINK_NATIVE_PRICE_FEED_ADDRESS = Address.fromString("{{chainlinkNativePriceFeedAddress}}")
Expand Down
3 changes: 2 additions & 1 deletion src/entity/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ethereum, log } from "@graphprotocol/graph-ts"
import { Transaction } from "../../generated/schema"
import { weiToBigDecimal } from "../utils/decimal"
import { ADDRESS_ZERO } from "../utils/address"

export function getTransaction(
block: ethereum.Block,
Expand All @@ -13,7 +14,7 @@ export function getTransaction(
tx = new Transaction(transactionId)
tx.blockNumber = block.number
tx.blockTimestamp = block.timestamp
tx.sender = transaction.from
tx.sender = transaction.from || ADDRESS_ZERO
if (!receipt) {
log.warning(
'No receipt for transaction {}. Set "receipt: true" on the event handler configuration in subgraph.yaml',
Expand Down

0 comments on commit 7f7f9d6

Please sign in to comment.