create-ponder 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -1
- package/package.json +1 -1
- package/templates/feature-multichain/_dot_env.local +3 -0
- package/templates/feature-multichain/ponder.config.ts +18 -0
- package/templates/reference-erc1155/README.md +24 -0
- package/templates/reference-erc1155/_dot_env.local +5 -0
- package/templates/reference-erc1155/_dot_eslintrc.json +3 -0
- package/templates/reference-erc1155/_dot_gitignore +18 -0
- package/templates/reference-erc1155/abis/erc1155Abi.ts +162 -0
- package/templates/reference-erc1155/package.json +25 -0
- package/templates/reference-erc1155/ponder-env.d.ts +27 -0
- package/templates/reference-erc1155/ponder.config.ts +20 -0
- package/templates/reference-erc1155/ponder.schema.ts +29 -0
- package/templates/reference-erc1155/src/index.ts +109 -0
- package/templates/reference-erc1155/tsconfig.json +26 -0
- package/templates/reference-erc20/README.md +1 -1
- package/templates/reference-erc20/abis/erc20ABI.ts +147 -0
- package/templates/reference-erc20/package.json +0 -1
- package/templates/reference-erc20/ponder.config.ts +1 -1
- package/templates/reference-erc20/src/index.ts +7 -7
- package/templates/reference-erc4626/README.md +57 -0
- package/templates/reference-erc4626/_dot_env.local +5 -0
- package/templates/reference-erc4626/_dot_eslintrc.json +3 -0
- package/templates/reference-erc4626/_dot_gitignore +18 -0
- package/templates/reference-erc4626/abis/erc4626ABI.ts +341 -0
- package/templates/reference-erc4626/package.json +25 -0
- package/templates/reference-erc4626/ponder-env.d.ts +27 -0
- package/templates/reference-erc4626/ponder.config.ts +21 -0
- package/templates/reference-erc4626/ponder.schema.ts +62 -0
- package/templates/reference-erc4626/src/index.ts +95 -0
- package/templates/reference-erc4626/tsconfig.json +26 -0
- package/templates/reference-erc721/README.md +1 -1
- package/templates/reference-erc721/abis/erc721ABI.ts +165 -0
- package/templates/reference-erc721/package.json +0 -1
- package/templates/reference-erc721/ponder.config.ts +1 -1
- package/templates/reference-erc721/src/index.ts +2 -2
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export const erc20ABI = [
|
|
2
|
+
{
|
|
3
|
+
stateMutability: "view",
|
|
4
|
+
type: "function",
|
|
5
|
+
inputs: [],
|
|
6
|
+
name: "DOMAIN_SEPARATOR",
|
|
7
|
+
outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
stateMutability: "view",
|
|
11
|
+
type: "function",
|
|
12
|
+
inputs: [
|
|
13
|
+
{ name: "", internalType: "address", type: "address" },
|
|
14
|
+
{ name: "", internalType: "address", type: "address" },
|
|
15
|
+
],
|
|
16
|
+
name: "allowance",
|
|
17
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
stateMutability: "nonpayable",
|
|
21
|
+
type: "function",
|
|
22
|
+
inputs: [
|
|
23
|
+
{ name: "spender", internalType: "address", type: "address" },
|
|
24
|
+
{ name: "amount", internalType: "uint256", type: "uint256" },
|
|
25
|
+
],
|
|
26
|
+
name: "approve",
|
|
27
|
+
outputs: [{ name: "", internalType: "bool", type: "bool" }],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
stateMutability: "view",
|
|
31
|
+
type: "function",
|
|
32
|
+
inputs: [{ name: "", internalType: "address", type: "address" }],
|
|
33
|
+
name: "balanceOf",
|
|
34
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
stateMutability: "view",
|
|
38
|
+
type: "function",
|
|
39
|
+
inputs: [],
|
|
40
|
+
name: "decimals",
|
|
41
|
+
outputs: [{ name: "", internalType: "uint8", type: "uint8" }],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
stateMutability: "view",
|
|
45
|
+
type: "function",
|
|
46
|
+
inputs: [],
|
|
47
|
+
name: "name",
|
|
48
|
+
outputs: [{ name: "", internalType: "string", type: "string" }],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
stateMutability: "view",
|
|
52
|
+
type: "function",
|
|
53
|
+
inputs: [{ name: "", internalType: "address", type: "address" }],
|
|
54
|
+
name: "nonces",
|
|
55
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
stateMutability: "nonpayable",
|
|
59
|
+
type: "function",
|
|
60
|
+
inputs: [
|
|
61
|
+
{ name: "owner", internalType: "address", type: "address" },
|
|
62
|
+
{ name: "spender", internalType: "address", type: "address" },
|
|
63
|
+
{ name: "value", internalType: "uint256", type: "uint256" },
|
|
64
|
+
{ name: "deadline", internalType: "uint256", type: "uint256" },
|
|
65
|
+
{ name: "v", internalType: "uint8", type: "uint8" },
|
|
66
|
+
{ name: "r", internalType: "bytes32", type: "bytes32" },
|
|
67
|
+
{ name: "s", internalType: "bytes32", type: "bytes32" },
|
|
68
|
+
],
|
|
69
|
+
name: "permit",
|
|
70
|
+
outputs: [],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
stateMutability: "view",
|
|
74
|
+
type: "function",
|
|
75
|
+
inputs: [],
|
|
76
|
+
name: "symbol",
|
|
77
|
+
outputs: [{ name: "", internalType: "string", type: "string" }],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
stateMutability: "view",
|
|
81
|
+
type: "function",
|
|
82
|
+
inputs: [],
|
|
83
|
+
name: "totalSupply",
|
|
84
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
stateMutability: "nonpayable",
|
|
88
|
+
type: "function",
|
|
89
|
+
inputs: [
|
|
90
|
+
{ name: "to", internalType: "address", type: "address" },
|
|
91
|
+
{ name: "amount", internalType: "uint256", type: "uint256" },
|
|
92
|
+
],
|
|
93
|
+
name: "transfer",
|
|
94
|
+
outputs: [{ name: "", internalType: "bool", type: "bool" }],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
stateMutability: "nonpayable",
|
|
98
|
+
type: "function",
|
|
99
|
+
inputs: [
|
|
100
|
+
{ name: "from", internalType: "address", type: "address" },
|
|
101
|
+
{ name: "to", internalType: "address", type: "address" },
|
|
102
|
+
{ name: "amount", internalType: "uint256", type: "uint256" },
|
|
103
|
+
],
|
|
104
|
+
name: "transferFrom",
|
|
105
|
+
outputs: [{ name: "", internalType: "bool", type: "bool" }],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: "event",
|
|
109
|
+
anonymous: false,
|
|
110
|
+
inputs: [
|
|
111
|
+
{
|
|
112
|
+
name: "owner",
|
|
113
|
+
internalType: "address",
|
|
114
|
+
type: "address",
|
|
115
|
+
indexed: true,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "spender",
|
|
119
|
+
internalType: "address",
|
|
120
|
+
type: "address",
|
|
121
|
+
indexed: true,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "amount",
|
|
125
|
+
internalType: "uint256",
|
|
126
|
+
type: "uint256",
|
|
127
|
+
indexed: false,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
name: "Approval",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: "event",
|
|
134
|
+
anonymous: false,
|
|
135
|
+
inputs: [
|
|
136
|
+
{ name: "from", internalType: "address", type: "address", indexed: true },
|
|
137
|
+
{ name: "to", internalType: "address", type: "address", indexed: true },
|
|
138
|
+
{
|
|
139
|
+
name: "amount",
|
|
140
|
+
internalType: "uint256",
|
|
141
|
+
type: "uint256",
|
|
142
|
+
indexed: false,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
name: "Transfer",
|
|
146
|
+
},
|
|
147
|
+
] as const;
|
|
@@ -11,7 +11,7 @@ ponder.on("ERC20:Transfer", async ({ event, context }) => {
|
|
|
11
11
|
isOwner: false,
|
|
12
12
|
},
|
|
13
13
|
update: ({ current }) => ({
|
|
14
|
-
balance: current.balance - event.args.
|
|
14
|
+
balance: current.balance - event.args.amount,
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -19,11 +19,11 @@ ponder.on("ERC20:Transfer", async ({ event, context }) => {
|
|
|
19
19
|
await Account.upsert({
|
|
20
20
|
id: event.args.to,
|
|
21
21
|
create: {
|
|
22
|
-
balance: event.args.
|
|
22
|
+
balance: event.args.amount,
|
|
23
23
|
isOwner: false,
|
|
24
24
|
},
|
|
25
25
|
update: ({ current }) => ({
|
|
26
|
-
balance: current.balance + event.args.
|
|
26
|
+
balance: current.balance + event.args.amount,
|
|
27
27
|
}),
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ ponder.on("ERC20:Transfer", async ({ event, context }) => {
|
|
|
33
33
|
data: {
|
|
34
34
|
fromId: event.args.from,
|
|
35
35
|
toId: event.args.to,
|
|
36
|
-
amount: event.args.
|
|
36
|
+
amount: event.args.amount,
|
|
37
37
|
timestamp: Number(event.block.timestamp),
|
|
38
38
|
},
|
|
39
39
|
});
|
|
@@ -50,10 +50,10 @@ ponder.on("ERC20:Approval", async ({ event, context }) => {
|
|
|
50
50
|
create: {
|
|
51
51
|
ownerId: event.args.owner,
|
|
52
52
|
spenderId: event.args.spender,
|
|
53
|
-
amount: event.args.
|
|
53
|
+
amount: event.args.amount,
|
|
54
54
|
},
|
|
55
55
|
update: {
|
|
56
|
-
amount: event.args.
|
|
56
|
+
amount: event.args.amount,
|
|
57
57
|
},
|
|
58
58
|
});
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ ponder.on("ERC20:Approval", async ({ event, context }) => {
|
|
|
63
63
|
data: {
|
|
64
64
|
ownerId: event.args.owner,
|
|
65
65
|
spenderId: event.args.spender,
|
|
66
|
-
amount: event.args.
|
|
66
|
+
amount: event.args.amount,
|
|
67
67
|
timestamp: Number(event.block.timestamp),
|
|
68
68
|
},
|
|
69
69
|
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Example ERC4626 token API
|
|
2
|
+
|
|
3
|
+
This example shows how to create a GraphQL API for an ERC4626 token using Ponder. It uses the Aave V2 token contract on Ethereum ([Link](https://etherscan.io/address/0xc21F107933612eCF5677894d45fc060767479A9b)).
|
|
4
|
+
|
|
5
|
+
## Sample queries
|
|
6
|
+
|
|
7
|
+
### Get the current balance and all approvals for an account
|
|
8
|
+
|
|
9
|
+
```graphql
|
|
10
|
+
{
|
|
11
|
+
account(id: "0x1337f7970E8399ccbc625647FCE58a9dADA5aA66") {
|
|
12
|
+
balance
|
|
13
|
+
approvals {
|
|
14
|
+
spender
|
|
15
|
+
amount
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Get the top 10 accounts by balance
|
|
22
|
+
|
|
23
|
+
```graphql
|
|
24
|
+
{
|
|
25
|
+
accounts(first: 10, orderBy: "balance", orderDirection: "desc") {
|
|
26
|
+
id
|
|
27
|
+
balance
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Get the current owner of the token contract
|
|
33
|
+
|
|
34
|
+
```graphql
|
|
35
|
+
{
|
|
36
|
+
accounts(where: { isOwner: true }) {
|
|
37
|
+
id
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Get all transfer events for an account
|
|
43
|
+
|
|
44
|
+
```graphql
|
|
45
|
+
{
|
|
46
|
+
account(id: "0x1337f7970E8399ccbc625647FCE58a9dADA5aA66") {
|
|
47
|
+
transferEventsTo {
|
|
48
|
+
from
|
|
49
|
+
amount
|
|
50
|
+
}
|
|
51
|
+
transferEventsFrom {
|
|
52
|
+
to
|
|
53
|
+
amount
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
export const erc4626ABI = [
|
|
2
|
+
{
|
|
3
|
+
type: "function",
|
|
4
|
+
name: "DOMAIN_SEPARATOR",
|
|
5
|
+
inputs: [],
|
|
6
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
7
|
+
stateMutability: "view",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: "function",
|
|
11
|
+
name: "allowance",
|
|
12
|
+
inputs: [
|
|
13
|
+
{ name: "", type: "address", internalType: "address" },
|
|
14
|
+
{ name: "", type: "address", internalType: "address" },
|
|
15
|
+
],
|
|
16
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
17
|
+
stateMutability: "view",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: "function",
|
|
21
|
+
name: "approve",
|
|
22
|
+
inputs: [
|
|
23
|
+
{ name: "spender", type: "address", internalType: "address" },
|
|
24
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
25
|
+
],
|
|
26
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
27
|
+
stateMutability: "nonpayable",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: "function",
|
|
31
|
+
name: "asset",
|
|
32
|
+
inputs: [],
|
|
33
|
+
outputs: [{ name: "", type: "address", internalType: "contract ERC20" }],
|
|
34
|
+
stateMutability: "view",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: "function",
|
|
38
|
+
name: "balanceOf",
|
|
39
|
+
inputs: [{ name: "", type: "address", internalType: "address" }],
|
|
40
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
41
|
+
stateMutability: "view",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: "function",
|
|
45
|
+
name: "convertToAssets",
|
|
46
|
+
inputs: [{ name: "shares", type: "uint256", internalType: "uint256" }],
|
|
47
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
48
|
+
stateMutability: "view",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: "function",
|
|
52
|
+
name: "convertToShares",
|
|
53
|
+
inputs: [{ name: "assets", type: "uint256", internalType: "uint256" }],
|
|
54
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
55
|
+
stateMutability: "view",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "function",
|
|
59
|
+
name: "decimals",
|
|
60
|
+
inputs: [],
|
|
61
|
+
outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
|
|
62
|
+
stateMutability: "view",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: "function",
|
|
66
|
+
name: "deposit",
|
|
67
|
+
inputs: [
|
|
68
|
+
{ name: "assets", type: "uint256", internalType: "uint256" },
|
|
69
|
+
{ name: "receiver", type: "address", internalType: "address" },
|
|
70
|
+
],
|
|
71
|
+
outputs: [{ name: "shares", type: "uint256", internalType: "uint256" }],
|
|
72
|
+
stateMutability: "nonpayable",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: "function",
|
|
76
|
+
name: "maxDeposit",
|
|
77
|
+
inputs: [{ name: "", type: "address", internalType: "address" }],
|
|
78
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
79
|
+
stateMutability: "view",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: "function",
|
|
83
|
+
name: "maxMint",
|
|
84
|
+
inputs: [{ name: "", type: "address", internalType: "address" }],
|
|
85
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
86
|
+
stateMutability: "view",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "function",
|
|
90
|
+
name: "maxRedeem",
|
|
91
|
+
inputs: [{ name: "owner", type: "address", internalType: "address" }],
|
|
92
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
93
|
+
stateMutability: "view",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: "function",
|
|
97
|
+
name: "maxWithdraw",
|
|
98
|
+
inputs: [{ name: "owner", type: "address", internalType: "address" }],
|
|
99
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
100
|
+
stateMutability: "view",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: "function",
|
|
104
|
+
name: "mint",
|
|
105
|
+
inputs: [
|
|
106
|
+
{ name: "shares", type: "uint256", internalType: "uint256" },
|
|
107
|
+
{ name: "receiver", type: "address", internalType: "address" },
|
|
108
|
+
],
|
|
109
|
+
outputs: [{ name: "assets", type: "uint256", internalType: "uint256" }],
|
|
110
|
+
stateMutability: "nonpayable",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "function",
|
|
114
|
+
name: "name",
|
|
115
|
+
inputs: [],
|
|
116
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
117
|
+
stateMutability: "view",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: "function",
|
|
121
|
+
name: "nonces",
|
|
122
|
+
inputs: [{ name: "", type: "address", internalType: "address" }],
|
|
123
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
124
|
+
stateMutability: "view",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: "function",
|
|
128
|
+
name: "permit",
|
|
129
|
+
inputs: [
|
|
130
|
+
{ name: "owner", type: "address", internalType: "address" },
|
|
131
|
+
{ name: "spender", type: "address", internalType: "address" },
|
|
132
|
+
{ name: "value", type: "uint256", internalType: "uint256" },
|
|
133
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
134
|
+
{ name: "v", type: "uint8", internalType: "uint8" },
|
|
135
|
+
{ name: "r", type: "bytes32", internalType: "bytes32" },
|
|
136
|
+
{ name: "s", type: "bytes32", internalType: "bytes32" },
|
|
137
|
+
],
|
|
138
|
+
outputs: [],
|
|
139
|
+
stateMutability: "nonpayable",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: "function",
|
|
143
|
+
name: "previewDeposit",
|
|
144
|
+
inputs: [{ name: "assets", type: "uint256", internalType: "uint256" }],
|
|
145
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
146
|
+
stateMutability: "view",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: "function",
|
|
150
|
+
name: "previewMint",
|
|
151
|
+
inputs: [{ name: "shares", type: "uint256", internalType: "uint256" }],
|
|
152
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
153
|
+
stateMutability: "view",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: "function",
|
|
157
|
+
name: "previewRedeem",
|
|
158
|
+
inputs: [{ name: "shares", type: "uint256", internalType: "uint256" }],
|
|
159
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
160
|
+
stateMutability: "view",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
type: "function",
|
|
164
|
+
name: "previewWithdraw",
|
|
165
|
+
inputs: [{ name: "assets", type: "uint256", internalType: "uint256" }],
|
|
166
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
167
|
+
stateMutability: "view",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: "function",
|
|
171
|
+
name: "redeem",
|
|
172
|
+
inputs: [
|
|
173
|
+
{ name: "shares", type: "uint256", internalType: "uint256" },
|
|
174
|
+
{ name: "receiver", type: "address", internalType: "address" },
|
|
175
|
+
{ name: "owner", type: "address", internalType: "address" },
|
|
176
|
+
],
|
|
177
|
+
outputs: [{ name: "assets", type: "uint256", internalType: "uint256" }],
|
|
178
|
+
stateMutability: "nonpayable",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: "function",
|
|
182
|
+
name: "symbol",
|
|
183
|
+
inputs: [],
|
|
184
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
185
|
+
stateMutability: "view",
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
type: "function",
|
|
189
|
+
name: "totalAssets",
|
|
190
|
+
inputs: [],
|
|
191
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
192
|
+
stateMutability: "view",
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: "function",
|
|
196
|
+
name: "totalSupply",
|
|
197
|
+
inputs: [],
|
|
198
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
199
|
+
stateMutability: "view",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
type: "function",
|
|
203
|
+
name: "transfer",
|
|
204
|
+
inputs: [
|
|
205
|
+
{ name: "to", type: "address", internalType: "address" },
|
|
206
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
207
|
+
],
|
|
208
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
209
|
+
stateMutability: "nonpayable",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
type: "function",
|
|
213
|
+
name: "transferFrom",
|
|
214
|
+
inputs: [
|
|
215
|
+
{ name: "from", type: "address", internalType: "address" },
|
|
216
|
+
{ name: "to", type: "address", internalType: "address" },
|
|
217
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
218
|
+
],
|
|
219
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
220
|
+
stateMutability: "nonpayable",
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
type: "function",
|
|
224
|
+
name: "withdraw",
|
|
225
|
+
inputs: [
|
|
226
|
+
{ name: "assets", type: "uint256", internalType: "uint256" },
|
|
227
|
+
{ name: "receiver", type: "address", internalType: "address" },
|
|
228
|
+
{ name: "owner", type: "address", internalType: "address" },
|
|
229
|
+
],
|
|
230
|
+
outputs: [{ name: "shares", type: "uint256", internalType: "uint256" }],
|
|
231
|
+
stateMutability: "nonpayable",
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
type: "event",
|
|
235
|
+
name: "Approval",
|
|
236
|
+
inputs: [
|
|
237
|
+
{
|
|
238
|
+
name: "owner",
|
|
239
|
+
type: "address",
|
|
240
|
+
indexed: true,
|
|
241
|
+
internalType: "address",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "spender",
|
|
245
|
+
type: "address",
|
|
246
|
+
indexed: true,
|
|
247
|
+
internalType: "address",
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "amount",
|
|
251
|
+
type: "uint256",
|
|
252
|
+
indexed: false,
|
|
253
|
+
internalType: "uint256",
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
anonymous: false,
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: "event",
|
|
260
|
+
name: "Deposit",
|
|
261
|
+
inputs: [
|
|
262
|
+
{
|
|
263
|
+
name: "caller",
|
|
264
|
+
type: "address",
|
|
265
|
+
indexed: true,
|
|
266
|
+
internalType: "address",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: "owner",
|
|
270
|
+
type: "address",
|
|
271
|
+
indexed: true,
|
|
272
|
+
internalType: "address",
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "assets",
|
|
276
|
+
type: "uint256",
|
|
277
|
+
indexed: false,
|
|
278
|
+
internalType: "uint256",
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: "shares",
|
|
282
|
+
type: "uint256",
|
|
283
|
+
indexed: false,
|
|
284
|
+
internalType: "uint256",
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
anonymous: false,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
type: "event",
|
|
291
|
+
name: "Transfer",
|
|
292
|
+
inputs: [
|
|
293
|
+
{ name: "from", type: "address", indexed: true, internalType: "address" },
|
|
294
|
+
{ name: "to", type: "address", indexed: true, internalType: "address" },
|
|
295
|
+
{
|
|
296
|
+
name: "amount",
|
|
297
|
+
type: "uint256",
|
|
298
|
+
indexed: false,
|
|
299
|
+
internalType: "uint256",
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
anonymous: false,
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
type: "event",
|
|
306
|
+
name: "Withdraw",
|
|
307
|
+
inputs: [
|
|
308
|
+
{
|
|
309
|
+
name: "caller",
|
|
310
|
+
type: "address",
|
|
311
|
+
indexed: true,
|
|
312
|
+
internalType: "address",
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "receiver",
|
|
316
|
+
type: "address",
|
|
317
|
+
indexed: true,
|
|
318
|
+
internalType: "address",
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: "owner",
|
|
322
|
+
type: "address",
|
|
323
|
+
indexed: true,
|
|
324
|
+
internalType: "address",
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: "assets",
|
|
328
|
+
type: "uint256",
|
|
329
|
+
indexed: false,
|
|
330
|
+
internalType: "uint256",
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: "shares",
|
|
334
|
+
type: "uint256",
|
|
335
|
+
indexed: false,
|
|
336
|
+
internalType: "uint256",
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
anonymous: false,
|
|
340
|
+
},
|
|
341
|
+
] as const;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ponder-examples-reference-erc4626",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "ponder dev",
|
|
7
|
+
"start": "ponder start",
|
|
8
|
+
"codegen": "ponder codegen",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"typecheck": "tsc"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@ponder/core": "workspace:*",
|
|
14
|
+
"viem": "^1.19.9"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^20.10.0",
|
|
18
|
+
"eslint": "^8.54.0",
|
|
19
|
+
"eslint-config-ponder": "workspace:*",
|
|
20
|
+
"typescript": "^5.3.2"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18.14"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// This file enables type checking and editor autocomplete for this Ponder project.
|
|
2
|
+
// After upgrading, you may find that changes have been made to this file.
|
|
3
|
+
// If this happens, please commit the changes. Do not manually edit this file.
|
|
4
|
+
// See https://ponder.sh/docs/guides/typescript for more information.
|
|
5
|
+
|
|
6
|
+
declare module "@/generated" {
|
|
7
|
+
import type { Virtual } from "@ponder/core";
|
|
8
|
+
|
|
9
|
+
type config = typeof import("./ponder.config.ts").default;
|
|
10
|
+
type schema = typeof import("./ponder.schema.ts").default;
|
|
11
|
+
|
|
12
|
+
export const ponder: Virtual.Registry<config, schema>;
|
|
13
|
+
|
|
14
|
+
export type EventNames = Virtual.EventNames<config>;
|
|
15
|
+
export type Event<name extends EventNames = EventNames> = Virtual.Event<
|
|
16
|
+
config,
|
|
17
|
+
name
|
|
18
|
+
>;
|
|
19
|
+
export type Context<name extends EventNames = EventNames> = Virtual.Context<
|
|
20
|
+
config,
|
|
21
|
+
schema,
|
|
22
|
+
name
|
|
23
|
+
>;
|
|
24
|
+
export type IndexingFunctionArgs<name extends EventNames = EventNames> =
|
|
25
|
+
Virtual.IndexingFunctionArgs<config, schema, name>;
|
|
26
|
+
export type Schema = Virtual.Schema<schema>;
|
|
27
|
+
}
|