update to latest deploy + multicall 2
This commit is contained in:
parent
f0f4110b4b
commit
d08cae175a
@ -27,7 +27,7 @@ export function getNetworkLibrary(): Web3Provider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const injected = new InjectedConnector({
|
export const injected = new InjectedConnector({
|
||||||
supportedChainIds: [1, 3, 4, 5, 42, 1337],
|
supportedChainIds: [1, 3, 4, 5, 42],
|
||||||
})
|
})
|
||||||
|
|
||||||
// mainnet only
|
// mainnet only
|
||||||
|
@ -1,143 +1,325 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"constant": true,
|
"inputs":[
|
||||||
"inputs": [],
|
{
|
||||||
"name": "getCurrentBlockTimestamp",
|
"components":[
|
||||||
"outputs": [
|
{
|
||||||
{
|
"internalType":"address",
|
||||||
"name": "timestamp",
|
"name":"target",
|
||||||
"type": "uint256"
|
"type":"address"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"payable": false,
|
"internalType":"bytes",
|
||||||
"stateMutability": "view",
|
"name":"callData",
|
||||||
"type": "function"
|
"type":"bytes"
|
||||||
},
|
}
|
||||||
{
|
],
|
||||||
"constant": true,
|
"internalType":"struct Multicall2.Call[]",
|
||||||
"inputs": [
|
"name":"calls",
|
||||||
{
|
"type":"tuple[]"
|
||||||
"components": [
|
}
|
||||||
{
|
],
|
||||||
"name": "target",
|
"name":"aggregate",
|
||||||
"type": "address"
|
"outputs":[
|
||||||
},
|
{
|
||||||
{
|
"internalType":"uint256",
|
||||||
"name": "callData",
|
"name":"blockNumber",
|
||||||
"type": "bytes"
|
"type":"uint256"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"name": "calls",
|
"internalType":"bytes[]",
|
||||||
"type": "tuple[]"
|
"name":"returnData",
|
||||||
}
|
"type":"bytes[]"
|
||||||
],
|
}
|
||||||
"name": "aggregate",
|
],
|
||||||
"outputs": [
|
"stateMutability":"nonpayable",
|
||||||
{
|
"type":"function"
|
||||||
"name": "blockNumber",
|
},
|
||||||
"type": "uint256"
|
{
|
||||||
},
|
"inputs":[
|
||||||
{
|
{
|
||||||
"name": "returnData",
|
"components":[
|
||||||
"type": "bytes[]"
|
{
|
||||||
}
|
"internalType":"address",
|
||||||
],
|
"name":"target",
|
||||||
"payable": false,
|
"type":"address"
|
||||||
"stateMutability": "view",
|
},
|
||||||
"type": "function"
|
{
|
||||||
},
|
"internalType":"bytes",
|
||||||
{
|
"name":"callData",
|
||||||
"constant": true,
|
"type":"bytes"
|
||||||
"inputs": [],
|
}
|
||||||
"name": "getLastBlockHash",
|
],
|
||||||
"outputs": [
|
"internalType":"struct Multicall2.Call[]",
|
||||||
{
|
"name":"calls",
|
||||||
"name": "blockHash",
|
"type":"tuple[]"
|
||||||
"type": "bytes32"
|
}
|
||||||
}
|
],
|
||||||
],
|
"name":"blockAndAggregate",
|
||||||
"payable": false,
|
"outputs":[
|
||||||
"stateMutability": "view",
|
{
|
||||||
"type": "function"
|
"internalType":"uint256",
|
||||||
},
|
"name":"blockNumber",
|
||||||
{
|
"type":"uint256"
|
||||||
"constant": true,
|
},
|
||||||
"inputs": [
|
{
|
||||||
{
|
"internalType":"bytes32",
|
||||||
"name": "addr",
|
"name":"blockHash",
|
||||||
"type": "address"
|
"type":"bytes32"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"name": "getEthBalance",
|
"components":[
|
||||||
"outputs": [
|
{
|
||||||
{
|
"internalType":"bool",
|
||||||
"name": "balance",
|
"name":"success",
|
||||||
"type": "uint256"
|
"type":"bool"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"payable": false,
|
"internalType":"bytes",
|
||||||
"stateMutability": "view",
|
"name":"returnData",
|
||||||
"type": "function"
|
"type":"bytes"
|
||||||
},
|
}
|
||||||
{
|
],
|
||||||
"constant": true,
|
"internalType":"struct Multicall2.Result[]",
|
||||||
"inputs": [],
|
"name":"returnData",
|
||||||
"name": "getCurrentBlockDifficulty",
|
"type":"tuple[]"
|
||||||
"outputs": [
|
}
|
||||||
{
|
],
|
||||||
"name": "difficulty",
|
"stateMutability":"nonpayable",
|
||||||
"type": "uint256"
|
"type":"function"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"payable": false,
|
"inputs":[
|
||||||
"stateMutability": "view",
|
{
|
||||||
"type": "function"
|
"internalType":"uint256",
|
||||||
},
|
"name":"blockNumber",
|
||||||
{
|
"type":"uint256"
|
||||||
"constant": true,
|
}
|
||||||
"inputs": [],
|
],
|
||||||
"name": "getCurrentBlockGasLimit",
|
"name":"getBlockHash",
|
||||||
"outputs": [
|
"outputs":[
|
||||||
{
|
{
|
||||||
"name": "gaslimit",
|
"internalType":"bytes32",
|
||||||
"type": "uint256"
|
"name":"blockHash",
|
||||||
}
|
"type":"bytes32"
|
||||||
],
|
}
|
||||||
"payable": false,
|
],
|
||||||
"stateMutability": "view",
|
"stateMutability":"view",
|
||||||
"type": "function"
|
"type":"function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"constant": true,
|
"inputs":[
|
||||||
"inputs": [],
|
|
||||||
"name": "getCurrentBlockCoinbase",
|
],
|
||||||
"outputs": [
|
"name":"getBlockNumber",
|
||||||
{
|
"outputs":[
|
||||||
"name": "coinbase",
|
{
|
||||||
"type": "address"
|
"internalType":"uint256",
|
||||||
}
|
"name":"blockNumber",
|
||||||
],
|
"type":"uint256"
|
||||||
"payable": false,
|
}
|
||||||
"stateMutability": "view",
|
],
|
||||||
"type": "function"
|
"stateMutability":"view",
|
||||||
},
|
"type":"function"
|
||||||
{
|
},
|
||||||
"constant": true,
|
{
|
||||||
"inputs": [
|
"inputs":[
|
||||||
{
|
|
||||||
"name": "blockNumber",
|
],
|
||||||
"type": "uint256"
|
"name":"getCurrentBlockCoinbase",
|
||||||
}
|
"outputs":[
|
||||||
],
|
{
|
||||||
"name": "getBlockHash",
|
"internalType":"address",
|
||||||
"outputs": [
|
"name":"coinbase",
|
||||||
{
|
"type":"address"
|
||||||
"name": "blockHash",
|
}
|
||||||
"type": "bytes32"
|
],
|
||||||
}
|
"stateMutability":"view",
|
||||||
],
|
"type":"function"
|
||||||
"payable": false,
|
},
|
||||||
"stateMutability": "view",
|
{
|
||||||
"type": "function"
|
"inputs":[
|
||||||
}
|
|
||||||
|
],
|
||||||
|
"name":"getCurrentBlockDifficulty",
|
||||||
|
"outputs":[
|
||||||
|
{
|
||||||
|
"internalType":"uint256",
|
||||||
|
"name":"difficulty",
|
||||||
|
"type":"uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability":"view",
|
||||||
|
"type":"function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"name":"getCurrentBlockGasLimit",
|
||||||
|
"outputs":[
|
||||||
|
{
|
||||||
|
"internalType":"uint256",
|
||||||
|
"name":"gaslimit",
|
||||||
|
"type":"uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability":"view",
|
||||||
|
"type":"function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"name":"getCurrentBlockTimestamp",
|
||||||
|
"outputs":[
|
||||||
|
{
|
||||||
|
"internalType":"uint256",
|
||||||
|
"name":"timestamp",
|
||||||
|
"type":"uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability":"view",
|
||||||
|
"type":"function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs":[
|
||||||
|
{
|
||||||
|
"internalType":"address",
|
||||||
|
"name":"addr",
|
||||||
|
"type":"address"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name":"getEthBalance",
|
||||||
|
"outputs":[
|
||||||
|
{
|
||||||
|
"internalType":"uint256",
|
||||||
|
"name":"balance",
|
||||||
|
"type":"uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability":"view",
|
||||||
|
"type":"function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"name":"getLastBlockHash",
|
||||||
|
"outputs":[
|
||||||
|
{
|
||||||
|
"internalType":"bytes32",
|
||||||
|
"name":"blockHash",
|
||||||
|
"type":"bytes32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability":"view",
|
||||||
|
"type":"function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs":[
|
||||||
|
{
|
||||||
|
"internalType":"bool",
|
||||||
|
"name":"requireSuccess",
|
||||||
|
"type":"bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"components":[
|
||||||
|
{
|
||||||
|
"internalType":"address",
|
||||||
|
"name":"target",
|
||||||
|
"type":"address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType":"bytes",
|
||||||
|
"name":"callData",
|
||||||
|
"type":"bytes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"internalType":"struct Multicall2.Call[]",
|
||||||
|
"name":"calls",
|
||||||
|
"type":"tuple[]"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name":"tryAggregate",
|
||||||
|
"outputs":[
|
||||||
|
{
|
||||||
|
"components":[
|
||||||
|
{
|
||||||
|
"internalType":"bool",
|
||||||
|
"name":"success",
|
||||||
|
"type":"bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType":"bytes",
|
||||||
|
"name":"returnData",
|
||||||
|
"type":"bytes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"internalType":"struct Multicall2.Result[]",
|
||||||
|
"name":"returnData",
|
||||||
|
"type":"tuple[]"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability":"nonpayable",
|
||||||
|
"type":"function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs":[
|
||||||
|
{
|
||||||
|
"internalType":"bool",
|
||||||
|
"name":"requireSuccess",
|
||||||
|
"type":"bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"components":[
|
||||||
|
{
|
||||||
|
"internalType":"address",
|
||||||
|
"name":"target",
|
||||||
|
"type":"address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType":"bytes",
|
||||||
|
"name":"callData",
|
||||||
|
"type":"bytes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"internalType":"struct Multicall2.Call[]",
|
||||||
|
"name":"calls",
|
||||||
|
"type":"tuple[]"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name":"tryBlockAndAggregate",
|
||||||
|
"outputs":[
|
||||||
|
{
|
||||||
|
"internalType":"uint256",
|
||||||
|
"name":"blockNumber",
|
||||||
|
"type":"uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType":"bytes32",
|
||||||
|
"name":"blockHash",
|
||||||
|
"type":"bytes32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"components":[
|
||||||
|
{
|
||||||
|
"internalType":"bool",
|
||||||
|
"name":"success",
|
||||||
|
"type":"bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType":"bytes",
|
||||||
|
"name":"returnData",
|
||||||
|
"type":"bytes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"internalType":"struct Multicall2.Result[]",
|
||||||
|
"name":"returnData",
|
||||||
|
"type":"tuple[]"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability":"nonpayable",
|
||||||
|
"type":"function"
|
||||||
|
}
|
||||||
]
|
]
|
@ -1,13 +1,12 @@
|
|||||||
import { ChainId } from '@uniswap/sdk-core'
|
import { ChainId } from '@uniswap/sdk-core'
|
||||||
import MULTICALL_ABI from './abi.json'
|
import MULTICALL_ABI from './abi.json'
|
||||||
|
|
||||||
const MULTICALL_NETWORKS: { [chainId in ChainId | 1337]: string } = {
|
const MULTICALL_NETWORKS: { [chainId in ChainId]: string } = {
|
||||||
[ChainId.MAINNET]: '0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441',
|
[ChainId.MAINNET]: '0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441',
|
||||||
[ChainId.ROPSTEN]: '0x53C43764255c17BD724F74c4eF150724AC50a3ed',
|
[ChainId.ROPSTEN]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696',
|
||||||
[ChainId.KOVAN]: '0x2cc8688C5f75E365aaEEb4ea8D6a480405A48D2A',
|
[ChainId.KOVAN]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696',
|
||||||
[ChainId.RINKEBY]: '0x42Ad527de7d4e9d9d011aC45B31D8551f8Fe9821',
|
[ChainId.RINKEBY]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696',
|
||||||
[ChainId.GÖRLI]: '0x77dCa2C955b15e9dE4dbBCf1246B4B85b651e50e',
|
[ChainId.GÖRLI]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696',
|
||||||
[1337]: '0xFeabCc62240297F1e4b238937D68e7516f0918D7',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export { MULTICALL_ABI, MULTICALL_NETWORKS }
|
export { MULTICALL_ABI, MULTICALL_NETWORKS }
|
||||||
|
@ -1,46 +1,41 @@
|
|||||||
import { ChainId } from '@uniswap/sdk-core'
|
import { ChainId } from '@uniswap/sdk-core'
|
||||||
|
|
||||||
export const FACTORY_ADDRESSES: { [chainId in ChainId | 1337]: string } = {
|
export const FACTORY_ADDRESSES: { [chainId in ChainId]: string } = {
|
||||||
[ChainId.MAINNET]: '',
|
[ChainId.MAINNET]: '',
|
||||||
[ChainId.ROPSTEN]: '',
|
[ChainId.ROPSTEN]: '',
|
||||||
[ChainId.RINKEBY]: '',
|
[ChainId.RINKEBY]: '',
|
||||||
[ChainId.GÖRLI]: '',
|
[ChainId.GÖRLI]: '0x2e52A6ed50aeD4396BdC5889ACB9D04F6804D150',
|
||||||
[ChainId.KOVAN]: '',
|
[ChainId.KOVAN]: '',
|
||||||
[1337]: '0x49A6d0854B0fF95065f0dA247b8a2d440D92D2c7',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TICK_LENS_ADDRESSES: { [chainId in ChainId | 1337]: string } = {
|
export const TICK_LENS_ADDRESSES: { [chainId in ChainId]: string } = {
|
||||||
[ChainId.MAINNET]: '',
|
[ChainId.MAINNET]: '',
|
||||||
[ChainId.ROPSTEN]: '',
|
[ChainId.ROPSTEN]: '',
|
||||||
[ChainId.RINKEBY]: '',
|
[ChainId.RINKEBY]: '',
|
||||||
[ChainId.GÖRLI]: '',
|
[ChainId.GÖRLI]: '0x637df729C49f229B328445AB64573B726F6814dC',
|
||||||
[ChainId.KOVAN]: '',
|
[ChainId.KOVAN]: '',
|
||||||
[1337]: '0x99Cb00560BFca3E5B7Cda8e820dDFF1ED403966E',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: { [chainId in ChainId | 1337]: string } = {
|
export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: { [chainId in ChainId]: string } = {
|
||||||
[ChainId.MAINNET]: '',
|
[ChainId.MAINNET]: '',
|
||||||
[ChainId.ROPSTEN]: '',
|
[ChainId.ROPSTEN]: '',
|
||||||
[ChainId.RINKEBY]: '',
|
[ChainId.RINKEBY]: '',
|
||||||
[ChainId.GÖRLI]: '',
|
[ChainId.GÖRLI]: '0x514A3562Bbf313B262A4d2377B559CDe75FAC3C9',
|
||||||
[ChainId.KOVAN]: '',
|
[ChainId.KOVAN]: '',
|
||||||
[1337]: '0x273Edaa13C845F605b5886Dd66C89AB497A6B17b',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NONFUNGIBLE_TOKEN_POSITION_DESCRIPTOR_ADDRESSES: { [chainId in ChainId | 1337]: string } = {
|
export const NONFUNGIBLE_TOKEN_POSITION_DESCRIPTOR_ADDRESSES: { [chainId in ChainId]: string } = {
|
||||||
[ChainId.MAINNET]: '',
|
[ChainId.MAINNET]: '',
|
||||||
[ChainId.ROPSTEN]: '',
|
[ChainId.ROPSTEN]: '',
|
||||||
[ChainId.RINKEBY]: '',
|
[ChainId.RINKEBY]: '',
|
||||||
[ChainId.GÖRLI]: '',
|
[ChainId.GÖRLI]: '0x2a3DB14c12674986f6F52deaD1d5ee0919715E8A',
|
||||||
[ChainId.KOVAN]: '',
|
[ChainId.KOVAN]: '',
|
||||||
[1337]: '0x3d137e860008BaF6d1c063158e5ec0baBbcFefF8',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SWAP_ROUTER_ADDRESSES: { [chainId in ChainId | 1337]: string } = {
|
export const SWAP_ROUTER_ADDRESSES: { [chainId in ChainId]: string } = {
|
||||||
[ChainId.MAINNET]: '',
|
[ChainId.MAINNET]: '',
|
||||||
[ChainId.ROPSTEN]: '',
|
[ChainId.ROPSTEN]: '',
|
||||||
[ChainId.RINKEBY]: '',
|
[ChainId.RINKEBY]: '',
|
||||||
[ChainId.GÖRLI]: '',
|
[ChainId.GÖRLI]: '0x86e14633F8ab81FD49aEF388172A43A7C8731664',
|
||||||
[ChainId.KOVAN]: '',
|
[ChainId.KOVAN]: '',
|
||||||
[1337]: '0x80AacDBEe92DC1c2Fbaa261Fb369696AF1AD9f98',
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ async function fetchChunk(
|
|||||||
console.debug('Fetching chunk', multicallContract, chunk, minBlockNumber)
|
console.debug('Fetching chunk', multicallContract, chunk, minBlockNumber)
|
||||||
let resultsBlockNumber, returnData
|
let resultsBlockNumber, returnData
|
||||||
try {
|
try {
|
||||||
;[resultsBlockNumber, returnData] = await multicallContract.aggregate(
|
;[resultsBlockNumber, returnData] = await multicallContract.callStatic.aggregate(
|
||||||
chunk.map((obj) => [obj.address, obj.callData])
|
chunk.map((obj) => [obj.address, obj.callData])
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user