@paraswap/dex-lib 3.5.4-v6.2.0 → 3.5.4-v6.2.1
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/build/dex/balancer-v2/balancer-v2.d.ts +2 -2
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/curve-v1/curve-v1.d.ts +2 -2
- package/build/dex/curve-v1/curve-v1.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +2 -2
- package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
- package/build/dex/curve-v2/curve-v2.d.ts +2 -2
- package/build/dex/curve-v2/curve-v2.js.map +1 -1
- package/build/dex/generic-rfq/generic-rfq.d.ts +1 -1
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/idex.d.ts +2 -2
- package/build/dex/maker-psm/maker-psm.d.ts +12 -3
- package/build/dex/maker-psm/maker-psm.js +66 -0
- package/build/dex/maker-psm/maker-psm.js.map +1 -1
- package/build/dex/maker-psm/scripts/gem.abi.json +136 -0
- package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
- package/build/dex/maker-psm/scripts/validate-state.js +185 -0
- package/build/dex/maker-psm/scripts/validate-state.js.map +1 -0
- package/build/dex/maker-psm/scripts/vat.abi.json +243 -0
- package/build/dex/maker-psm/types.d.ts +15 -1
- package/build/dex/uniswap-v2/uniswap-v2.d.ts +2 -2
- package/build/dex/uniswap-v2/uniswap-v2.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.d.ts +2 -2
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex/zerox/index.d.ts +1 -1
- package/build/dex/zerox/index.js.map +1 -1
- package/package.json +1 -1
- package/src/dex/balancer-v2/balancer-v2.ts +2 -2
- package/src/dex/curve-v1/curve-v1.ts +2 -2
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +2 -2
- package/src/dex/curve-v2/curve-v2.ts +2 -2
- package/src/dex/generic-rfq/generic-rfq.ts +1 -1
- package/src/dex/idex.ts +2 -2
- package/src/dex/maker-psm/maker-psm-e2e.test.ts +8 -33
- package/src/dex/maker-psm/maker-psm.ts +136 -5
- package/src/dex/maker-psm/scripts/gem.abi.json +136 -0
- package/src/dex/maker-psm/scripts/validate-state.ts +221 -0
- package/src/dex/maker-psm/scripts/vat.abi.json +243 -0
- package/src/dex/maker-psm/types.ts +17 -1
- package/src/dex/uniswap-v2/uniswap-v2.ts +2 -2
- package/src/dex/uniswap-v3/uniswap-v3.ts +2 -2
- package/src/dex/zerox/index.ts +1 -1
- package/tests/constants-e2e.ts +1 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// /* eslint-disable no-console */
|
|
2
|
+
// import dotenv from 'dotenv';
|
|
3
|
+
// dotenv.config();
|
|
4
|
+
|
|
5
|
+
// import { Network } from '../../../constants';
|
|
6
|
+
// import { DummyDexHelper } from '../../../dex-helper';
|
|
7
|
+
// import { BlockHeader } from 'web3-eth';
|
|
8
|
+
// import { MakerPsmConfig } from '../config';
|
|
9
|
+
// import { BigNumber, ethers } from 'ethers';
|
|
10
|
+
// import { Interface } from '@ethersproject/abi';
|
|
11
|
+
// import _ from 'lodash';
|
|
12
|
+
// import vatABI from './vat.abi.json';
|
|
13
|
+
// import gemABI from './gem.abi.json';
|
|
14
|
+
// // @ts-ignore
|
|
15
|
+
// import { Tokens } from '../../../../tests/constants-e2e';
|
|
16
|
+
|
|
17
|
+
// const tokens = Tokens[Network.MAINNET];
|
|
18
|
+
|
|
19
|
+
// const vatInterface = new Interface(vatABI);
|
|
20
|
+
// const gemInterface = new Interface(gemABI);
|
|
21
|
+
// const erc20Interface = new Interface([
|
|
22
|
+
// {
|
|
23
|
+
// constant: true,
|
|
24
|
+
// inputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
25
|
+
// name: 'balanceOf',
|
|
26
|
+
// outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
27
|
+
// payable: false,
|
|
28
|
+
// stateMutability: 'view',
|
|
29
|
+
// type: 'function',
|
|
30
|
+
// },
|
|
31
|
+
// ]);
|
|
32
|
+
|
|
33
|
+
// const network = Network.MAINNET;
|
|
34
|
+
// const vat = MakerPsmConfig.MakerPsm[Network.MAINNET].vatAddress;
|
|
35
|
+
// const MOVE_TOPIC =
|
|
36
|
+
// '0xbb35783b00000000000000000000000000000000000000000000000000000000';
|
|
37
|
+
|
|
38
|
+
// const dexHelper = new DummyDexHelper(network);
|
|
39
|
+
|
|
40
|
+
// async function findNewGems(): Promise<boolean> {
|
|
41
|
+
// const network = Network.MAINNET;
|
|
42
|
+
// const dexHelper = new DummyDexHelper(network);
|
|
43
|
+
|
|
44
|
+
// const lastBlockNumber = await dexHelper.provider.getBlockNumber();
|
|
45
|
+
|
|
46
|
+
// const startBlockNumber = lastBlockNumber - 1_000_000;
|
|
47
|
+
// const endBlockNumber = lastBlockNumber;
|
|
48
|
+
// // const startBlockNumber = endBlockNumber - 700_000;
|
|
49
|
+
|
|
50
|
+
// const totalRange = endBlockNumber - startBlockNumber;
|
|
51
|
+
|
|
52
|
+
// const smallChunkSize = 10_000;
|
|
53
|
+
// const bigChunkSize = 100_000;
|
|
54
|
+
|
|
55
|
+
// const bigChunks = Math.ceil(totalRange / bigChunkSize);
|
|
56
|
+
|
|
57
|
+
// const smallChunks = Math.ceil(bigChunkSize / smallChunkSize);
|
|
58
|
+
|
|
59
|
+
// const uniquePotentialGemJoinsSet = new Set();
|
|
60
|
+
|
|
61
|
+
// for (let i = 0; i < bigChunks; i++) {
|
|
62
|
+
// console.log('Processing chunk', i + 1, 'of', bigChunks);
|
|
63
|
+
// const from = startBlockNumber + i * bigChunkSize;
|
|
64
|
+
// console.log(
|
|
65
|
+
// new Array(smallChunks).fill(0).map((_, smallChunkNumber) => ({
|
|
66
|
+
// fromBlock: from + smallChunkNumber * smallChunkSize,
|
|
67
|
+
// toBlock: from + smallChunkNumber * smallChunkSize + smallChunkSize,
|
|
68
|
+
// })),
|
|
69
|
+
// );
|
|
70
|
+
|
|
71
|
+
// const logsToDispatch = (
|
|
72
|
+
// await Promise.all(
|
|
73
|
+
// new Array(smallChunks).fill(0).map((_, smallChunkNumber) =>
|
|
74
|
+
// dexHelper.provider.getLogs({
|
|
75
|
+
// fromBlock: from + smallChunkNumber * smallChunkSize,
|
|
76
|
+
// toBlock: from + smallChunkNumber * smallChunkSize + smallChunkSize,
|
|
77
|
+
// address: vat,
|
|
78
|
+
// }),
|
|
79
|
+
// ),
|
|
80
|
+
// )
|
|
81
|
+
// ).flat();
|
|
82
|
+
|
|
83
|
+
// const moveLogs = logsToDispatch.filter(l => l.topics[0] === MOVE_TOPIC);
|
|
84
|
+
|
|
85
|
+
// const potentialGemJoins = moveLogs.map(
|
|
86
|
+
// l => ethers.utils.defaultAbiCoder.decode(['address'], l.topics[1])[0],
|
|
87
|
+
// );
|
|
88
|
+
|
|
89
|
+
// potentialGemJoins.forEach(gemJoin =>
|
|
90
|
+
// uniquePotentialGemJoinsSet.add(gemJoin),
|
|
91
|
+
// );
|
|
92
|
+
// }
|
|
93
|
+
|
|
94
|
+
// const uniquePotentialGemJoins = Array.from(uniquePotentialGemJoinsSet);
|
|
95
|
+
// console.log('unique potential gem joins', uniquePotentialGemJoins.length);
|
|
96
|
+
|
|
97
|
+
// const gemJoinCalldata = uniquePotentialGemJoins
|
|
98
|
+
// .map(gemJoin => {
|
|
99
|
+
// return [
|
|
100
|
+
// {
|
|
101
|
+
// target: gemJoin,
|
|
102
|
+
// callData: vatInterface.encodeFunctionData('gemJoin'),
|
|
103
|
+
// },
|
|
104
|
+
// ];
|
|
105
|
+
// })
|
|
106
|
+
// .flat();
|
|
107
|
+
|
|
108
|
+
// const slicedGemJoinCallData = _.chunk(gemJoinCalldata, 500);
|
|
109
|
+
|
|
110
|
+
// const gemJoinData = (
|
|
111
|
+
// await Promise.all(
|
|
112
|
+
// slicedGemJoinCallData.map(async _multiCallData =>
|
|
113
|
+
// dexHelper.multiContract.methods
|
|
114
|
+
// .tryAggregate(false, _multiCallData)
|
|
115
|
+
// .call({}),
|
|
116
|
+
// ),
|
|
117
|
+
// )
|
|
118
|
+
// ).flat();
|
|
119
|
+
|
|
120
|
+
// // console.log(
|
|
121
|
+
// // gemJoinData
|
|
122
|
+
// // .map((data, i) => ({ ...data, index: i }))
|
|
123
|
+
// // .filter(d => d.returnData !== '0x' && d.returnData.length === 66)
|
|
124
|
+
// // .map(d => [d.returnData, gemJoinCalldata[d.index]]),
|
|
125
|
+
// // );
|
|
126
|
+
|
|
127
|
+
// const gemJoins = gemJoinData
|
|
128
|
+
// .filter(d => d.returnData !== '0x' && d.returnData.length === 66)
|
|
129
|
+
// .map(
|
|
130
|
+
// d => ethers.utils.defaultAbiCoder.decode(['address'], d.returnData)[0],
|
|
131
|
+
// );
|
|
132
|
+
|
|
133
|
+
// const uniqueGemJoins = [...new Set(gemJoins)];
|
|
134
|
+
// console.log('unique gem joins', uniqueGemJoins.length);
|
|
135
|
+
|
|
136
|
+
// const gemCalldata = uniqueGemJoins
|
|
137
|
+
// .map(gemJoin => {
|
|
138
|
+
// return [
|
|
139
|
+
// {
|
|
140
|
+
// target: gemJoin,
|
|
141
|
+
// callData: gemInterface.encodeFunctionData('gem'),
|
|
142
|
+
// },
|
|
143
|
+
// ];
|
|
144
|
+
// })
|
|
145
|
+
// .flat();
|
|
146
|
+
|
|
147
|
+
// const returnGemData = await dexHelper.multiContract.methods
|
|
148
|
+
// .tryAggregate(false, gemCalldata)
|
|
149
|
+
// .call({});
|
|
150
|
+
|
|
151
|
+
// const gems = returnGemData
|
|
152
|
+
// .filter((d: any) => d.returnData !== '0x')
|
|
153
|
+
// .map(
|
|
154
|
+
// (d: any) =>
|
|
155
|
+
// ethers.utils.defaultAbiCoder.decode(['address'], d.returnData)[0],
|
|
156
|
+
// );
|
|
157
|
+
|
|
158
|
+
// const balanceCalldata = gems
|
|
159
|
+
// .map((gem: any, i: number) => {
|
|
160
|
+
// return [
|
|
161
|
+
// {
|
|
162
|
+
// target: gem,
|
|
163
|
+
// callData: erc20Interface.encodeFunctionData('balanceOf', [
|
|
164
|
+
// uniqueGemJoins[i],
|
|
165
|
+
// ]),
|
|
166
|
+
// },
|
|
167
|
+
// ];
|
|
168
|
+
// })
|
|
169
|
+
// .flat();
|
|
170
|
+
|
|
171
|
+
// const returnBalanceData = await dexHelper.multiContract.methods
|
|
172
|
+
// .tryAggregate(false, balanceCalldata)
|
|
173
|
+
// .call({});
|
|
174
|
+
|
|
175
|
+
// console.log(returnBalanceData);
|
|
176
|
+
|
|
177
|
+
// const balances: BigNumber[] = returnBalanceData
|
|
178
|
+
// .filter((d: any) => d.returnData !== '0x')
|
|
179
|
+
// .map(
|
|
180
|
+
// (d: any) =>
|
|
181
|
+
// ethers.utils.defaultAbiCoder.decode(['uint256'], d.returnData)[0],
|
|
182
|
+
// );
|
|
183
|
+
|
|
184
|
+
// console.log(balances.map(b => b.toString()));
|
|
185
|
+
|
|
186
|
+
// const data = uniqueGemJoins.map((gemJoin, i) => {
|
|
187
|
+
// const token = Object.values(tokens).find(
|
|
188
|
+
// t => t.address.toLowerCase() === gems[i].toLowerCase(),
|
|
189
|
+
// );
|
|
190
|
+
// const symbol = token
|
|
191
|
+
// ? Object.entries(tokens).find(
|
|
192
|
+
// ([symbol, t]) => t.address.toLowerCase() === gems[i].toLowerCase(),
|
|
193
|
+
// )?.[0]
|
|
194
|
+
// : 'Not found';
|
|
195
|
+
// const balance = token
|
|
196
|
+
// ? Number(ethers.utils.formatUnits(balances[i], token.decimals))
|
|
197
|
+
// : balances[i].toString();
|
|
198
|
+
|
|
199
|
+
// return {
|
|
200
|
+
// gemJoin,
|
|
201
|
+
// gem: gems[i],
|
|
202
|
+
// balance,
|
|
203
|
+
// ...(token
|
|
204
|
+
// ? {
|
|
205
|
+
// address: gems[i],
|
|
206
|
+
// decimals: token.decimals,
|
|
207
|
+
// symbol,
|
|
208
|
+
// }
|
|
209
|
+
// : { address: gems[i] }),
|
|
210
|
+
// };
|
|
211
|
+
// });
|
|
212
|
+
|
|
213
|
+
// console.log(data);
|
|
214
|
+
|
|
215
|
+
// // const address = logsToDispatch[0].address;
|
|
216
|
+
// return true;
|
|
217
|
+
// }
|
|
218
|
+
|
|
219
|
+
// findNewGems()
|
|
220
|
+
// .then(() => console.log('Done'))
|
|
221
|
+
// .catch(e => console.error(e));
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{ "internalType": "address", "name": "gemJoin_", "type": "address" },
|
|
5
|
+
{ "internalType": "address", "name": "daiJoin_", "type": "address" },
|
|
6
|
+
{ "internalType": "address", "name": "vow_", "type": "address" }
|
|
7
|
+
],
|
|
8
|
+
"stateMutability": "nonpayable",
|
|
9
|
+
"type": "constructor"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"anonymous": false,
|
|
13
|
+
"inputs": [
|
|
14
|
+
{
|
|
15
|
+
"indexed": true,
|
|
16
|
+
"internalType": "address",
|
|
17
|
+
"name": "owner",
|
|
18
|
+
"type": "address"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"indexed": false,
|
|
22
|
+
"internalType": "uint256",
|
|
23
|
+
"name": "value",
|
|
24
|
+
"type": "uint256"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"indexed": false,
|
|
28
|
+
"internalType": "uint256",
|
|
29
|
+
"name": "fee",
|
|
30
|
+
"type": "uint256"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"name": "BuyGem",
|
|
34
|
+
"type": "event"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"anonymous": false,
|
|
38
|
+
"inputs": [
|
|
39
|
+
{
|
|
40
|
+
"indexed": false,
|
|
41
|
+
"internalType": "address",
|
|
42
|
+
"name": "user",
|
|
43
|
+
"type": "address"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"name": "Deny",
|
|
47
|
+
"type": "event"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"anonymous": false,
|
|
51
|
+
"inputs": [
|
|
52
|
+
{
|
|
53
|
+
"indexed": true,
|
|
54
|
+
"internalType": "bytes32",
|
|
55
|
+
"name": "what",
|
|
56
|
+
"type": "bytes32"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"indexed": false,
|
|
60
|
+
"internalType": "uint256",
|
|
61
|
+
"name": "data",
|
|
62
|
+
"type": "uint256"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"name": "File",
|
|
66
|
+
"type": "event"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"anonymous": false,
|
|
70
|
+
"inputs": [
|
|
71
|
+
{
|
|
72
|
+
"indexed": false,
|
|
73
|
+
"internalType": "address",
|
|
74
|
+
"name": "user",
|
|
75
|
+
"type": "address"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"name": "Rely",
|
|
79
|
+
"type": "event"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"anonymous": false,
|
|
83
|
+
"inputs": [
|
|
84
|
+
{
|
|
85
|
+
"indexed": true,
|
|
86
|
+
"internalType": "address",
|
|
87
|
+
"name": "owner",
|
|
88
|
+
"type": "address"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"indexed": false,
|
|
92
|
+
"internalType": "uint256",
|
|
93
|
+
"name": "value",
|
|
94
|
+
"type": "uint256"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"indexed": false,
|
|
98
|
+
"internalType": "uint256",
|
|
99
|
+
"name": "fee",
|
|
100
|
+
"type": "uint256"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"name": "SellGem",
|
|
104
|
+
"type": "event"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"inputs": [
|
|
108
|
+
{ "internalType": "address", "name": "usr", "type": "address" },
|
|
109
|
+
{ "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
|
|
110
|
+
],
|
|
111
|
+
"name": "buyGem",
|
|
112
|
+
"outputs": [],
|
|
113
|
+
"stateMutability": "nonpayable",
|
|
114
|
+
"type": "function"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"inputs": [],
|
|
118
|
+
"name": "dai",
|
|
119
|
+
"outputs": [
|
|
120
|
+
{ "internalType": "contract DaiAbstract", "name": "", "type": "address" }
|
|
121
|
+
],
|
|
122
|
+
"stateMutability": "view",
|
|
123
|
+
"type": "function"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"inputs": [],
|
|
127
|
+
"name": "daiJoin",
|
|
128
|
+
"outputs": [
|
|
129
|
+
{
|
|
130
|
+
"internalType": "contract DaiJoinAbstract",
|
|
131
|
+
"name": "",
|
|
132
|
+
"type": "address"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"stateMutability": "view",
|
|
136
|
+
"type": "function"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
140
|
+
"name": "deny",
|
|
141
|
+
"outputs": [],
|
|
142
|
+
"stateMutability": "nonpayable",
|
|
143
|
+
"type": "function"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"inputs": [
|
|
147
|
+
{ "internalType": "bytes32", "name": "what", "type": "bytes32" },
|
|
148
|
+
{ "internalType": "uint256", "name": "data", "type": "uint256" }
|
|
149
|
+
],
|
|
150
|
+
"name": "file",
|
|
151
|
+
"outputs": [],
|
|
152
|
+
"stateMutability": "nonpayable",
|
|
153
|
+
"type": "function"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"inputs": [],
|
|
157
|
+
"name": "gemJoin",
|
|
158
|
+
"outputs": [
|
|
159
|
+
{
|
|
160
|
+
"internalType": "contract AuthGemJoinAbstract",
|
|
161
|
+
"name": "",
|
|
162
|
+
"type": "address"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"stateMutability": "view",
|
|
166
|
+
"type": "function"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
170
|
+
"name": "hope",
|
|
171
|
+
"outputs": [],
|
|
172
|
+
"stateMutability": "nonpayable",
|
|
173
|
+
"type": "function"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"inputs": [],
|
|
177
|
+
"name": "ilk",
|
|
178
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
179
|
+
"stateMutability": "view",
|
|
180
|
+
"type": "function"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
184
|
+
"name": "nope",
|
|
185
|
+
"outputs": [],
|
|
186
|
+
"stateMutability": "nonpayable",
|
|
187
|
+
"type": "function"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
191
|
+
"name": "rely",
|
|
192
|
+
"outputs": [],
|
|
193
|
+
"stateMutability": "nonpayable",
|
|
194
|
+
"type": "function"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"inputs": [
|
|
198
|
+
{ "internalType": "address", "name": "usr", "type": "address" },
|
|
199
|
+
{ "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
|
|
200
|
+
],
|
|
201
|
+
"name": "sellGem",
|
|
202
|
+
"outputs": [],
|
|
203
|
+
"stateMutability": "nonpayable",
|
|
204
|
+
"type": "function"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"inputs": [],
|
|
208
|
+
"name": "tin",
|
|
209
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
210
|
+
"stateMutability": "view",
|
|
211
|
+
"type": "function"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"inputs": [],
|
|
215
|
+
"name": "tout",
|
|
216
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
217
|
+
"stateMutability": "view",
|
|
218
|
+
"type": "function"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"inputs": [],
|
|
222
|
+
"name": "vat",
|
|
223
|
+
"outputs": [
|
|
224
|
+
{ "internalType": "contract VatAbstract", "name": "", "type": "address" }
|
|
225
|
+
],
|
|
226
|
+
"stateMutability": "view",
|
|
227
|
+
"type": "function"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"inputs": [],
|
|
231
|
+
"name": "vow",
|
|
232
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
233
|
+
"stateMutability": "view",
|
|
234
|
+
"type": "function"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
238
|
+
"name": "wards",
|
|
239
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
240
|
+
"stateMutability": "view",
|
|
241
|
+
"type": "function"
|
|
242
|
+
}
|
|
243
|
+
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Token } from '../../types';
|
|
1
|
+
import { Address, NumberAsString, Token } from '../../types';
|
|
2
2
|
|
|
3
3
|
export type PoolState = {
|
|
4
4
|
tin: bigint; // toll in
|
|
@@ -13,6 +13,7 @@ export type MakerPsmData = {
|
|
|
13
13
|
gemJoinAddress: Address;
|
|
14
14
|
gemDecimals: number;
|
|
15
15
|
toll: string;
|
|
16
|
+
isApproved?: boolean;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export type PoolConfig = {
|
|
@@ -27,3 +28,18 @@ export type DexParams = {
|
|
|
27
28
|
vatAddress: Address;
|
|
28
29
|
pools: PoolConfig[];
|
|
29
30
|
};
|
|
31
|
+
|
|
32
|
+
export type MakerPsmParams = [
|
|
33
|
+
srcToken: Address,
|
|
34
|
+
destToken: Address,
|
|
35
|
+
fromAmount: NumberAsString,
|
|
36
|
+
toAmount: NumberAsString,
|
|
37
|
+
toll: NumberAsString,
|
|
38
|
+
to18ConversionFactor: NumberAsString,
|
|
39
|
+
exchange: Address,
|
|
40
|
+
gemJoinAddress: Address,
|
|
41
|
+
metadata: string,
|
|
42
|
+
beneficiaryDirectionApproveFlag: NumberAsString,
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
export type MakerPsmDirectPayload = [params: MakerPsmParams, permit: string];
|
|
@@ -938,7 +938,7 @@ export class UniswapV2
|
|
|
938
938
|
deadline: NumberAsString,
|
|
939
939
|
partner: string,
|
|
940
940
|
beneficiary: string,
|
|
941
|
-
contractMethod
|
|
941
|
+
contractMethod: string,
|
|
942
942
|
): TxInfo<UniswapParam> {
|
|
943
943
|
if (!contractMethod) throw new Error(`contractMethod need to be passed`);
|
|
944
944
|
if (permit !== '0x') contractMethod += 'WithPermit';
|
|
@@ -1014,7 +1014,7 @@ export class UniswapV2
|
|
|
1014
1014
|
partnerAndFee: string,
|
|
1015
1015
|
beneficiary: string,
|
|
1016
1016
|
blockNumber: number,
|
|
1017
|
-
contractMethod
|
|
1017
|
+
contractMethod: string,
|
|
1018
1018
|
) {
|
|
1019
1019
|
if (!contractMethod) throw new Error(`contractMethod need to be passed`);
|
|
1020
1020
|
if (!UniswapV2.getDirectFunctionNameV6().includes(contractMethod!)) {
|
|
@@ -960,7 +960,7 @@ export class UniswapV3
|
|
|
960
960
|
deadline: NumberAsString,
|
|
961
961
|
partner: string,
|
|
962
962
|
beneficiary: string,
|
|
963
|
-
contractMethod
|
|
963
|
+
contractMethod: string,
|
|
964
964
|
): TxInfo<UniswapV3Param> {
|
|
965
965
|
if (!UniswapV3.getDirectFunctionName().includes(contractMethod!)) {
|
|
966
966
|
throw new Error(`Invalid contract method ${contractMethod}`);
|
|
@@ -1023,7 +1023,7 @@ export class UniswapV3
|
|
|
1023
1023
|
partnerAndFee: string,
|
|
1024
1024
|
beneficiary: string,
|
|
1025
1025
|
blockNumber: number,
|
|
1026
|
-
contractMethod
|
|
1026
|
+
contractMethod: string,
|
|
1027
1027
|
) {
|
|
1028
1028
|
if (!UniswapV3.getDirectFunctionNameV6().includes(contractMethod!)) {
|
|
1029
1029
|
throw new Error(`Invalid contract method ${contractMethod}`);
|
package/src/dex/zerox/index.ts
CHANGED
|
@@ -275,7 +275,7 @@ export class ZeroX
|
|
|
275
275
|
deadline: NumberAsString,
|
|
276
276
|
partner: string,
|
|
277
277
|
beneficiary: string,
|
|
278
|
-
contractMethod
|
|
278
|
+
contractMethod: string,
|
|
279
279
|
): TxInfo<ZeroXParam> {
|
|
280
280
|
const usePermit = permit !== '0x';
|
|
281
281
|
const encoder = (...params: ZeroXParam) => {
|
package/tests/constants-e2e.ts
CHANGED
|
@@ -1314,7 +1314,7 @@ export const Holders: {
|
|
|
1314
1314
|
CVX: '0x0aCA67Fa70B142A3b9bF2eD89A81B40ff85dACdC',
|
|
1315
1315
|
MIM: '0xa046a8660e66d178ee07ec97c585eeb6aa18c26c',
|
|
1316
1316
|
AnkETH: '0xF7260D4ADc48fEefd5a19a9Eb23f9747CeE15C92',
|
|
1317
|
-
DAI: '
|
|
1317
|
+
DAI: '0xd1668fb5f690c59ab4b0cabad0f8c1617895052b',
|
|
1318
1318
|
oldFRAX: '0x183d0dc5867c01bfb1dbbc41d6a9d3de6e044626',
|
|
1319
1319
|
newFRAX: '0x183d0dc5867c01bfb1dbbc41d6a9d3de6e044626',
|
|
1320
1320
|
FEI: '0x19c549357034d10db8d75ed812b45be1dd8a7218',
|