mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2025-01-07 05:48:03 -05:00
remove mining related staff
This commit is contained in:
parent
8d2bad2a41
commit
6f66b34288
1077
abis/mining.abi.json
1077
abis/mining.abi.json
File diff suppressed because it is too large
Load Diff
@ -1,252 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "bytes32",
|
|
||||||
"name": "_torn",
|
|
||||||
"type": "bytes32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "bytes32",
|
|
||||||
"name": "_miner",
|
|
||||||
"type": "bytes32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "_miningCap",
|
|
||||||
"type": "uint256"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "_initialLiquidity",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "constructor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "newWeight",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "PoolWeightUpdated",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "recipient",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "pTORN",
|
|
||||||
"type": "uint256"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "TORN",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Swap",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "DURATION",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "initialLiquidity",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "liquidity",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "miner",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "poolWeight",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "bytes32",
|
|
||||||
"name": "node",
|
|
||||||
"type": "bytes32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "resolve",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "startTimestamp",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "tokensSold",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "torn",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "contract IERC20",
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "recipient",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "amount",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "swap",
|
|
||||||
"outputs": [],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "amount",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "getExpectedReturn",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "tornVirtualBalance",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "newWeight",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "setPoolWeight",
|
|
||||||
"outputs": [],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
}
|
|
||||||
]
|
|
85902
cache/accounts_farmer_1.json
vendored
85902
cache/accounts_farmer_1.json
vendored
File diff suppressed because it is too large
Load Diff
5878
cache/accounts_farmer_5.json
vendored
5878
cache/accounts_farmer_5.json
vendored
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,11 @@ import type {
|
|||||||
Signer,
|
Signer,
|
||||||
utils,
|
utils,
|
||||||
} from "ethers";
|
} from "ethers";
|
||||||
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
import type {
|
||||||
|
FunctionFragment,
|
||||||
|
Result,
|
||||||
|
EventFragment,
|
||||||
|
} from "@ethersproject/abi";
|
||||||
import type { Listener, Provider } from "@ethersproject/providers";
|
import type { Listener, Provider } from "@ethersproject/providers";
|
||||||
import type {
|
import type {
|
||||||
TypedEventFilter,
|
TypedEventFilter,
|
||||||
@ -22,135 +26,213 @@ import type {
|
|||||||
OnEvent,
|
OnEvent,
|
||||||
} from "./common";
|
} from "./common";
|
||||||
|
|
||||||
export declare namespace GovernanceAggregator {
|
|
||||||
export type ProposalStruct = {
|
|
||||||
proposer: string;
|
|
||||||
target: string;
|
|
||||||
startTime: BigNumberish;
|
|
||||||
endTime: BigNumberish;
|
|
||||||
forVotes: BigNumberish;
|
|
||||||
againstVotes: BigNumberish;
|
|
||||||
executed: boolean;
|
|
||||||
extended: boolean;
|
|
||||||
state: BigNumberish;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ProposalStructOutput = [
|
|
||||||
string,
|
|
||||||
string,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
boolean,
|
|
||||||
boolean,
|
|
||||||
number
|
|
||||||
] & {
|
|
||||||
proposer: string;
|
|
||||||
target: string;
|
|
||||||
startTime: BigNumber;
|
|
||||||
endTime: BigNumber;
|
|
||||||
forVotes: BigNumber;
|
|
||||||
againstVotes: BigNumber;
|
|
||||||
executed: boolean;
|
|
||||||
extended: boolean;
|
|
||||||
state: number;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AggregatorAbiInterface extends utils.Interface {
|
export interface AggregatorAbiInterface extends utils.Interface {
|
||||||
|
contractName: "AggregatorAbi";
|
||||||
|
|
||||||
functions: {
|
functions: {
|
||||||
"bulkResolve(bytes32[])": FunctionFragment;
|
"addConnector(address)": FunctionFragment;
|
||||||
"getAllProposals(address)": FunctionFragment;
|
"addOracle(address,uint8)": FunctionFragment;
|
||||||
"getGovernanceBalances(address,address[])": FunctionFragment;
|
"connectors()": FunctionFragment;
|
||||||
"getPricesInETH(address[],uint256[])": FunctionFragment;
|
"getRate(address,address,bool)": FunctionFragment;
|
||||||
"getUserData(address,address)": FunctionFragment;
|
"getRateToEth(address,bool)": FunctionFragment;
|
||||||
"minerRates(address,address[])": FunctionFragment;
|
"multiWrapper()": FunctionFragment;
|
||||||
"resolve(bytes32)": FunctionFragment;
|
"oracles()": FunctionFragment;
|
||||||
"swapState(address)": FunctionFragment;
|
"owner()": FunctionFragment;
|
||||||
"miningData(address,address[],address)": FunctionFragment;
|
"removeConnector(address)": FunctionFragment;
|
||||||
"marketData(address[],uint256[],address)": FunctionFragment;
|
"removeOracle(address,uint8)": FunctionFragment;
|
||||||
|
"renounceOwnership()": FunctionFragment;
|
||||||
|
"setMultiWrapper(address)": FunctionFragment;
|
||||||
|
"transferOwnership(address)": FunctionFragment;
|
||||||
};
|
};
|
||||||
|
|
||||||
getFunction(
|
getFunction(
|
||||||
nameOrSignatureOrTopic:
|
nameOrSignatureOrTopic:
|
||||||
| "bulkResolve"
|
| "addConnector"
|
||||||
| "getAllProposals"
|
| "addOracle"
|
||||||
| "getGovernanceBalances"
|
| "connectors"
|
||||||
| "getPricesInETH"
|
| "getRate"
|
||||||
| "getUserData"
|
| "getRateToEth"
|
||||||
| "minerRates"
|
| "multiWrapper"
|
||||||
| "resolve"
|
| "oracles"
|
||||||
| "swapState"
|
| "owner"
|
||||||
| "miningData"
|
| "removeConnector"
|
||||||
| "marketData"
|
| "removeOracle"
|
||||||
|
| "renounceOwnership"
|
||||||
|
| "setMultiWrapper"
|
||||||
|
| "transferOwnership"
|
||||||
): FunctionFragment;
|
): FunctionFragment;
|
||||||
|
|
||||||
encodeFunctionData(
|
encodeFunctionData(
|
||||||
functionFragment: "bulkResolve",
|
functionFragment: "addConnector",
|
||||||
values: [BytesLike[]]
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "getAllProposals",
|
|
||||||
values: [string]
|
values: [string]
|
||||||
): string;
|
): string;
|
||||||
encodeFunctionData(
|
encodeFunctionData(
|
||||||
functionFragment: "getGovernanceBalances",
|
functionFragment: "addOracle",
|
||||||
values: [string, string[]]
|
values: [string, BigNumberish]
|
||||||
): string;
|
): string;
|
||||||
encodeFunctionData(
|
encodeFunctionData(
|
||||||
functionFragment: "getPricesInETH",
|
functionFragment: "connectors",
|
||||||
values: [string[], BigNumberish[]]
|
values?: undefined
|
||||||
): string;
|
): string;
|
||||||
encodeFunctionData(
|
encodeFunctionData(
|
||||||
functionFragment: "getUserData",
|
functionFragment: "getRate",
|
||||||
values: [string, string]
|
values: [string, string, boolean]
|
||||||
): string;
|
): string;
|
||||||
encodeFunctionData(
|
encodeFunctionData(
|
||||||
functionFragment: "minerRates",
|
functionFragment: "getRateToEth",
|
||||||
values: [string, string[]]
|
values: [string, boolean]
|
||||||
): string;
|
|
||||||
encodeFunctionData(functionFragment: "resolve", values: [BytesLike]): string;
|
|
||||||
encodeFunctionData(functionFragment: "swapState", values: [string]): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "miningData",
|
|
||||||
values: [string, string[], string]
|
|
||||||
): string;
|
): string;
|
||||||
encodeFunctionData(
|
encodeFunctionData(
|
||||||
functionFragment: "marketData",
|
functionFragment: "multiWrapper",
|
||||||
values: [string[], BigNumberish[], string]
|
values?: undefined
|
||||||
|
): string;
|
||||||
|
encodeFunctionData(functionFragment: "oracles", values?: undefined): string;
|
||||||
|
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||||
|
encodeFunctionData(
|
||||||
|
functionFragment: "removeConnector",
|
||||||
|
values: [string]
|
||||||
|
): string;
|
||||||
|
encodeFunctionData(
|
||||||
|
functionFragment: "removeOracle",
|
||||||
|
values: [string, BigNumberish]
|
||||||
|
): string;
|
||||||
|
encodeFunctionData(
|
||||||
|
functionFragment: "renounceOwnership",
|
||||||
|
values?: undefined
|
||||||
|
): string;
|
||||||
|
encodeFunctionData(
|
||||||
|
functionFragment: "setMultiWrapper",
|
||||||
|
values: [string]
|
||||||
|
): string;
|
||||||
|
encodeFunctionData(
|
||||||
|
functionFragment: "transferOwnership",
|
||||||
|
values: [string]
|
||||||
): string;
|
): string;
|
||||||
|
|
||||||
decodeFunctionResult(
|
decodeFunctionResult(
|
||||||
functionFragment: "bulkResolve",
|
functionFragment: "addConnector",
|
||||||
|
data: BytesLike
|
||||||
|
): Result;
|
||||||
|
decodeFunctionResult(functionFragment: "addOracle", data: BytesLike): Result;
|
||||||
|
decodeFunctionResult(functionFragment: "connectors", data: BytesLike): Result;
|
||||||
|
decodeFunctionResult(functionFragment: "getRate", data: BytesLike): Result;
|
||||||
|
decodeFunctionResult(
|
||||||
|
functionFragment: "getRateToEth",
|
||||||
data: BytesLike
|
data: BytesLike
|
||||||
): Result;
|
): Result;
|
||||||
decodeFunctionResult(
|
decodeFunctionResult(
|
||||||
functionFragment: "getAllProposals",
|
functionFragment: "multiWrapper",
|
||||||
|
data: BytesLike
|
||||||
|
): Result;
|
||||||
|
decodeFunctionResult(functionFragment: "oracles", data: BytesLike): Result;
|
||||||
|
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||||
|
decodeFunctionResult(
|
||||||
|
functionFragment: "removeConnector",
|
||||||
data: BytesLike
|
data: BytesLike
|
||||||
): Result;
|
): Result;
|
||||||
decodeFunctionResult(
|
decodeFunctionResult(
|
||||||
functionFragment: "getGovernanceBalances",
|
functionFragment: "removeOracle",
|
||||||
data: BytesLike
|
data: BytesLike
|
||||||
): Result;
|
): Result;
|
||||||
decodeFunctionResult(
|
decodeFunctionResult(
|
||||||
functionFragment: "getPricesInETH",
|
functionFragment: "renounceOwnership",
|
||||||
data: BytesLike
|
data: BytesLike
|
||||||
): Result;
|
): Result;
|
||||||
decodeFunctionResult(
|
decodeFunctionResult(
|
||||||
functionFragment: "getUserData",
|
functionFragment: "setMultiWrapper",
|
||||||
|
data: BytesLike
|
||||||
|
): Result;
|
||||||
|
decodeFunctionResult(
|
||||||
|
functionFragment: "transferOwnership",
|
||||||
data: BytesLike
|
data: BytesLike
|
||||||
): Result;
|
): Result;
|
||||||
decodeFunctionResult(functionFragment: "minerRates", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "resolve", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "swapState", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "miningData", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "marketData", data: BytesLike): Result;
|
|
||||||
|
|
||||||
events: {};
|
events: {
|
||||||
|
"ConnectorAdded(address)": EventFragment;
|
||||||
|
"ConnectorRemoved(address)": EventFragment;
|
||||||
|
"MultiWrapperUpdated(address)": EventFragment;
|
||||||
|
"OracleAdded(address,uint8)": EventFragment;
|
||||||
|
"OracleRemoved(address,uint8)": EventFragment;
|
||||||
|
"OwnershipTransferred(address,address)": EventFragment;
|
||||||
|
};
|
||||||
|
|
||||||
|
getEvent(nameOrSignatureOrTopic: "ConnectorAdded"): EventFragment;
|
||||||
|
getEvent(nameOrSignatureOrTopic: "ConnectorRemoved"): EventFragment;
|
||||||
|
getEvent(nameOrSignatureOrTopic: "MultiWrapperUpdated"): EventFragment;
|
||||||
|
getEvent(nameOrSignatureOrTopic: "OracleAdded"): EventFragment;
|
||||||
|
getEvent(nameOrSignatureOrTopic: "OracleRemoved"): EventFragment;
|
||||||
|
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ConnectorAddedEventObject {
|
||||||
|
connector: string;
|
||||||
|
}
|
||||||
|
export type ConnectorAddedEvent = TypedEvent<
|
||||||
|
[string],
|
||||||
|
ConnectorAddedEventObject
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type ConnectorAddedEventFilter = TypedEventFilter<ConnectorAddedEvent>;
|
||||||
|
|
||||||
|
export interface ConnectorRemovedEventObject {
|
||||||
|
connector: string;
|
||||||
|
}
|
||||||
|
export type ConnectorRemovedEvent = TypedEvent<
|
||||||
|
[string],
|
||||||
|
ConnectorRemovedEventObject
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type ConnectorRemovedEventFilter =
|
||||||
|
TypedEventFilter<ConnectorRemovedEvent>;
|
||||||
|
|
||||||
|
export interface MultiWrapperUpdatedEventObject {
|
||||||
|
multiWrapper: string;
|
||||||
|
}
|
||||||
|
export type MultiWrapperUpdatedEvent = TypedEvent<
|
||||||
|
[string],
|
||||||
|
MultiWrapperUpdatedEventObject
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type MultiWrapperUpdatedEventFilter =
|
||||||
|
TypedEventFilter<MultiWrapperUpdatedEvent>;
|
||||||
|
|
||||||
|
export interface OracleAddedEventObject {
|
||||||
|
oracle: string;
|
||||||
|
oracleType: number;
|
||||||
|
}
|
||||||
|
export type OracleAddedEvent = TypedEvent<
|
||||||
|
[string, number],
|
||||||
|
OracleAddedEventObject
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type OracleAddedEventFilter = TypedEventFilter<OracleAddedEvent>;
|
||||||
|
|
||||||
|
export interface OracleRemovedEventObject {
|
||||||
|
oracle: string;
|
||||||
|
oracleType: number;
|
||||||
|
}
|
||||||
|
export type OracleRemovedEvent = TypedEvent<
|
||||||
|
[string, number],
|
||||||
|
OracleRemovedEventObject
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type OracleRemovedEventFilter = TypedEventFilter<OracleRemovedEvent>;
|
||||||
|
|
||||||
|
export interface OwnershipTransferredEventObject {
|
||||||
|
previousOwner: string;
|
||||||
|
newOwner: string;
|
||||||
|
}
|
||||||
|
export type OwnershipTransferredEvent = TypedEvent<
|
||||||
|
[string, string],
|
||||||
|
OwnershipTransferredEventObject
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type OwnershipTransferredEventFilter =
|
||||||
|
TypedEventFilter<OwnershipTransferredEvent>;
|
||||||
|
|
||||||
export interface AggregatorAbi extends BaseContract {
|
export interface AggregatorAbi extends BaseContract {
|
||||||
|
contractName: "AggregatorAbi";
|
||||||
|
|
||||||
connect(signerOrProvider: Signer | Provider | string): this;
|
connect(signerOrProvider: Signer | Provider | string): this;
|
||||||
attach(addressOrName: string): this;
|
attach(addressOrName: string): this;
|
||||||
deployed(): Promise<this>;
|
deployed(): Promise<this>;
|
||||||
@ -177,345 +259,338 @@ export interface AggregatorAbi extends BaseContract {
|
|||||||
removeListener: OnEvent<this>;
|
removeListener: OnEvent<this>;
|
||||||
|
|
||||||
functions: {
|
functions: {
|
||||||
bulkResolve(
|
addConnector(
|
||||||
domains: BytesLike[],
|
connector: string,
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<ContractTransaction>;
|
): Promise<ContractTransaction>;
|
||||||
|
|
||||||
getAllProposals(
|
addOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
|
oracleKind: BigNumberish,
|
||||||
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
): Promise<ContractTransaction>;
|
||||||
|
|
||||||
|
connectors(
|
||||||
|
overrides?: CallOverrides
|
||||||
|
): Promise<[string[]] & { allConnectors: string[] }>;
|
||||||
|
|
||||||
|
getRate(
|
||||||
|
srcToken: string,
|
||||||
|
dstToken: string,
|
||||||
|
useWrappers: boolean,
|
||||||
|
overrides?: CallOverrides
|
||||||
|
): Promise<[BigNumber] & { weightedRate: BigNumber }>;
|
||||||
|
|
||||||
|
getRateToEth(
|
||||||
|
srcToken: string,
|
||||||
|
useSrcWrappers: boolean,
|
||||||
|
overrides?: CallOverrides
|
||||||
|
): Promise<[BigNumber] & { weightedRate: BigNumber }>;
|
||||||
|
|
||||||
|
multiWrapper(overrides?: CallOverrides): Promise<[string]>;
|
||||||
|
|
||||||
|
oracles(
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<
|
||||||
[GovernanceAggregator.ProposalStructOutput[]] & {
|
[string[], number[]] & { allOracles: string[]; oracleTypes: number[] }
|
||||||
proposals: GovernanceAggregator.ProposalStructOutput[];
|
|
||||||
}
|
|
||||||
>;
|
>;
|
||||||
|
|
||||||
getGovernanceBalances(
|
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||||
governance: string,
|
|
||||||
accs: string[],
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<[BigNumber[]] & { amounts: BigNumber[] }>;
|
|
||||||
|
|
||||||
getPricesInETH(
|
removeConnector(
|
||||||
fromTokens: string[],
|
connector: string,
|
||||||
oneUnitAmounts: BigNumberish[],
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
overrides?: CallOverrides
|
): Promise<ContractTransaction>;
|
||||||
): Promise<[BigNumber[]] & { prices: BigNumber[] }>;
|
|
||||||
|
|
||||||
getUserData(
|
removeOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
account: string,
|
oracleKind: BigNumberish,
|
||||||
overrides?: CallOverrides
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<
|
): Promise<ContractTransaction>;
|
||||||
[BigNumber, BigNumber, BigNumber, BigNumber, string] & {
|
|
||||||
balance: BigNumber;
|
|
||||||
latestProposalId: BigNumber;
|
|
||||||
latestProposalIdState: BigNumber;
|
|
||||||
timelock: BigNumber;
|
|
||||||
delegatee: string;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
minerRates(
|
renounceOwnership(
|
||||||
miner: string,
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
instances: string[],
|
): Promise<ContractTransaction>;
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<[BigNumber[]] & { _rates: BigNumber[] }>;
|
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<[string]>;
|
setMultiWrapper(
|
||||||
|
_multiWrapper: string,
|
||||||
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
): Promise<ContractTransaction>;
|
||||||
|
|
||||||
swapState(
|
transferOwnership(
|
||||||
swap: string,
|
newOwner: string,
|
||||||
overrides?: CallOverrides
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<
|
): Promise<ContractTransaction>;
|
||||||
[BigNumber, BigNumber] & { balance: BigNumber; poolWeight: BigNumber }
|
|
||||||
>;
|
|
||||||
|
|
||||||
miningData(
|
|
||||||
miner: string,
|
|
||||||
instances: string[],
|
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<
|
|
||||||
[BigNumber[], BigNumber, BigNumber] & {
|
|
||||||
_rates: BigNumber[];
|
|
||||||
balance: BigNumber;
|
|
||||||
poolWeight: BigNumber;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
marketData(
|
|
||||||
fromTokens: string[],
|
|
||||||
oneUnitAmounts: BigNumberish[],
|
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<
|
|
||||||
[BigNumber[], BigNumber] & { prices: BigNumber[]; balance: BigNumber }
|
|
||||||
>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bulkResolve(
|
addConnector(
|
||||||
domains: BytesLike[],
|
connector: string,
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<ContractTransaction>;
|
): Promise<ContractTransaction>;
|
||||||
|
|
||||||
getAllProposals(
|
addOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
overrides?: CallOverrides
|
oracleKind: BigNumberish,
|
||||||
): Promise<GovernanceAggregator.ProposalStructOutput[]>;
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
): Promise<ContractTransaction>;
|
||||||
|
|
||||||
getGovernanceBalances(
|
connectors(overrides?: CallOverrides): Promise<string[]>;
|
||||||
governance: string,
|
|
||||||
accs: string[],
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber[]>;
|
|
||||||
|
|
||||||
getPricesInETH(
|
getRate(
|
||||||
fromTokens: string[],
|
srcToken: string,
|
||||||
oneUnitAmounts: BigNumberish[],
|
dstToken: string,
|
||||||
|
useWrappers: boolean,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<BigNumber[]>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
getUserData(
|
getRateToEth(
|
||||||
governance: string,
|
srcToken: string,
|
||||||
account: string,
|
useSrcWrappers: boolean,
|
||||||
|
overrides?: CallOverrides
|
||||||
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
|
multiWrapper(overrides?: CallOverrides): Promise<string>;
|
||||||
|
|
||||||
|
oracles(
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<
|
||||||
[BigNumber, BigNumber, BigNumber, BigNumber, string] & {
|
[string[], number[]] & { allOracles: string[]; oracleTypes: number[] }
|
||||||
balance: BigNumber;
|
|
||||||
latestProposalId: BigNumber;
|
|
||||||
latestProposalIdState: BigNumber;
|
|
||||||
timelock: BigNumber;
|
|
||||||
delegatee: string;
|
|
||||||
}
|
|
||||||
>;
|
>;
|
||||||
|
|
||||||
minerRates(
|
owner(overrides?: CallOverrides): Promise<string>;
|
||||||
miner: string,
|
|
||||||
instances: string[],
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber[]>;
|
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<string>;
|
removeConnector(
|
||||||
|
connector: string,
|
||||||
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
): Promise<ContractTransaction>;
|
||||||
|
|
||||||
swapState(
|
removeOracle(
|
||||||
swap: string,
|
oracle: string,
|
||||||
overrides?: CallOverrides
|
oracleKind: BigNumberish,
|
||||||
): Promise<
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
[BigNumber, BigNumber] & { balance: BigNumber; poolWeight: BigNumber }
|
): Promise<ContractTransaction>;
|
||||||
>;
|
|
||||||
|
|
||||||
miningData(
|
renounceOwnership(
|
||||||
miner: string,
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
instances: string[],
|
): Promise<ContractTransaction>;
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<
|
|
||||||
[BigNumber[], BigNumber, BigNumber] & {
|
|
||||||
_rates: BigNumber[];
|
|
||||||
balance: BigNumber;
|
|
||||||
poolWeight: BigNumber;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
marketData(
|
setMultiWrapper(
|
||||||
fromTokens: string[],
|
_multiWrapper: string,
|
||||||
oneUnitAmounts: BigNumberish[],
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
swap: string,
|
): Promise<ContractTransaction>;
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<
|
transferOwnership(
|
||||||
[BigNumber[], BigNumber] & { prices: BigNumber[]; balance: BigNumber }
|
newOwner: string,
|
||||||
>;
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
): Promise<ContractTransaction>;
|
||||||
|
|
||||||
callStatic: {
|
callStatic: {
|
||||||
bulkResolve(
|
addConnector(connector: string, overrides?: CallOverrides): Promise<void>;
|
||||||
domains: BytesLike[],
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<string[]>;
|
|
||||||
|
|
||||||
getAllProposals(
|
addOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
|
oracleKind: BigNumberish,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<GovernanceAggregator.ProposalStructOutput[]>;
|
): Promise<void>;
|
||||||
|
|
||||||
getGovernanceBalances(
|
connectors(overrides?: CallOverrides): Promise<string[]>;
|
||||||
governance: string,
|
|
||||||
accs: string[],
|
getRate(
|
||||||
|
srcToken: string,
|
||||||
|
dstToken: string,
|
||||||
|
useWrappers: boolean,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<BigNumber[]>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
getPricesInETH(
|
getRateToEth(
|
||||||
fromTokens: string[],
|
srcToken: string,
|
||||||
oneUnitAmounts: BigNumberish[],
|
useSrcWrappers: boolean,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<BigNumber[]>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
getUserData(
|
multiWrapper(overrides?: CallOverrides): Promise<string>;
|
||||||
governance: string,
|
|
||||||
account: string,
|
oracles(
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<
|
||||||
[BigNumber, BigNumber, BigNumber, BigNumber, string] & {
|
[string[], number[]] & { allOracles: string[]; oracleTypes: number[] }
|
||||||
balance: BigNumber;
|
|
||||||
latestProposalId: BigNumber;
|
|
||||||
latestProposalIdState: BigNumber;
|
|
||||||
timelock: BigNumber;
|
|
||||||
delegatee: string;
|
|
||||||
}
|
|
||||||
>;
|
>;
|
||||||
|
|
||||||
minerRates(
|
owner(overrides?: CallOverrides): Promise<string>;
|
||||||
miner: string,
|
|
||||||
instances: string[],
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber[]>;
|
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<string>;
|
removeConnector(
|
||||||
|
connector: string,
|
||||||
swapState(
|
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<void>;
|
||||||
[BigNumber, BigNumber] & { balance: BigNumber; poolWeight: BigNumber }
|
|
||||||
>;
|
|
||||||
|
|
||||||
miningData(
|
removeOracle(
|
||||||
miner: string,
|
oracle: string,
|
||||||
instances: string[],
|
oracleKind: BigNumberish,
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<void>;
|
||||||
[BigNumber[], BigNumber, BigNumber] & {
|
|
||||||
_rates: BigNumber[];
|
|
||||||
balance: BigNumber;
|
|
||||||
poolWeight: BigNumber;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
marketData(
|
renounceOwnership(overrides?: CallOverrides): Promise<void>;
|
||||||
fromTokens: string[],
|
|
||||||
oneUnitAmounts: BigNumberish[],
|
setMultiWrapper(
|
||||||
swap: string,
|
_multiWrapper: string,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<void>;
|
||||||
[BigNumber[], BigNumber] & { prices: BigNumber[]; balance: BigNumber }
|
|
||||||
>;
|
transferOwnership(
|
||||||
|
newOwner: string,
|
||||||
|
overrides?: CallOverrides
|
||||||
|
): Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
filters: {};
|
filters: {
|
||||||
|
"ConnectorAdded(address)"(connector?: null): ConnectorAddedEventFilter;
|
||||||
|
ConnectorAdded(connector?: null): ConnectorAddedEventFilter;
|
||||||
|
|
||||||
|
"ConnectorRemoved(address)"(connector?: null): ConnectorRemovedEventFilter;
|
||||||
|
ConnectorRemoved(connector?: null): ConnectorRemovedEventFilter;
|
||||||
|
|
||||||
|
"MultiWrapperUpdated(address)"(
|
||||||
|
multiWrapper?: null
|
||||||
|
): MultiWrapperUpdatedEventFilter;
|
||||||
|
MultiWrapperUpdated(multiWrapper?: null): MultiWrapperUpdatedEventFilter;
|
||||||
|
|
||||||
|
"OracleAdded(address,uint8)"(
|
||||||
|
oracle?: null,
|
||||||
|
oracleType?: null
|
||||||
|
): OracleAddedEventFilter;
|
||||||
|
OracleAdded(oracle?: null, oracleType?: null): OracleAddedEventFilter;
|
||||||
|
|
||||||
|
"OracleRemoved(address,uint8)"(
|
||||||
|
oracle?: null,
|
||||||
|
oracleType?: null
|
||||||
|
): OracleRemovedEventFilter;
|
||||||
|
OracleRemoved(oracle?: null, oracleType?: null): OracleRemovedEventFilter;
|
||||||
|
|
||||||
|
"OwnershipTransferred(address,address)"(
|
||||||
|
previousOwner?: string | null,
|
||||||
|
newOwner?: string | null
|
||||||
|
): OwnershipTransferredEventFilter;
|
||||||
|
OwnershipTransferred(
|
||||||
|
previousOwner?: string | null,
|
||||||
|
newOwner?: string | null
|
||||||
|
): OwnershipTransferredEventFilter;
|
||||||
|
};
|
||||||
|
|
||||||
estimateGas: {
|
estimateGas: {
|
||||||
bulkResolve(
|
addConnector(
|
||||||
domains: BytesLike[],
|
connector: string,
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
getAllProposals(
|
addOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
|
oracleKind: BigNumberish,
|
||||||
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
|
connectors(overrides?: CallOverrides): Promise<BigNumber>;
|
||||||
|
|
||||||
|
getRate(
|
||||||
|
srcToken: string,
|
||||||
|
dstToken: string,
|
||||||
|
useWrappers: boolean,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
getGovernanceBalances(
|
getRateToEth(
|
||||||
governance: string,
|
srcToken: string,
|
||||||
accs: string[],
|
useSrcWrappers: boolean,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
getPricesInETH(
|
multiWrapper(overrides?: CallOverrides): Promise<BigNumber>;
|
||||||
fromTokens: string[],
|
|
||||||
oneUnitAmounts: BigNumberish[],
|
oracles(overrides?: CallOverrides): Promise<BigNumber>;
|
||||||
overrides?: CallOverrides
|
|
||||||
|
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||||
|
|
||||||
|
removeConnector(
|
||||||
|
connector: string,
|
||||||
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
getUserData(
|
removeOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
account: string,
|
oracleKind: BigNumberish,
|
||||||
overrides?: CallOverrides
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
minerRates(
|
renounceOwnership(
|
||||||
miner: string,
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
instances: string[],
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
|
setMultiWrapper(
|
||||||
|
_multiWrapper: string,
|
||||||
swapState(swap: string, overrides?: CallOverrides): Promise<BigNumber>;
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
|
||||||
miningData(
|
|
||||||
miner: string,
|
|
||||||
instances: string[],
|
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
|
|
||||||
marketData(
|
transferOwnership(
|
||||||
fromTokens: string[],
|
newOwner: string,
|
||||||
oneUnitAmounts: BigNumberish[],
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber>;
|
): Promise<BigNumber>;
|
||||||
};
|
};
|
||||||
|
|
||||||
populateTransaction: {
|
populateTransaction: {
|
||||||
bulkResolve(
|
addConnector(
|
||||||
domains: BytesLike[],
|
connector: string,
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
getAllProposals(
|
addOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
|
oracleKind: BigNumberish,
|
||||||
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
|
connectors(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
|
getRate(
|
||||||
|
srcToken: string,
|
||||||
|
dstToken: string,
|
||||||
|
useWrappers: boolean,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
getGovernanceBalances(
|
getRateToEth(
|
||||||
governance: string,
|
srcToken: string,
|
||||||
accs: string[],
|
useSrcWrappers: boolean,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
getPricesInETH(
|
multiWrapper(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||||
fromTokens: string[],
|
|
||||||
oneUnitAmounts: BigNumberish[],
|
oracles(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||||
overrides?: CallOverrides
|
|
||||||
|
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
|
removeConnector(
|
||||||
|
connector: string,
|
||||||
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
getUserData(
|
removeOracle(
|
||||||
governance: string,
|
oracle: string,
|
||||||
account: string,
|
oracleKind: BigNumberish,
|
||||||
overrides?: CallOverrides
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
minerRates(
|
renounceOwnership(
|
||||||
miner: string,
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
instances: string[],
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
resolve(
|
setMultiWrapper(
|
||||||
node: BytesLike,
|
_multiWrapper: string,
|
||||||
overrides?: CallOverrides
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
|
|
||||||
swapState(
|
transferOwnership(
|
||||||
swap: string,
|
newOwner: string,
|
||||||
overrides?: CallOverrides
|
overrides?: Overrides & { from?: string | Promise<string> }
|
||||||
): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
miningData(
|
|
||||||
miner: string,
|
|
||||||
instances: string[],
|
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
marketData(
|
|
||||||
fromTokens: string[],
|
|
||||||
oneUnitAmounts: BigNumberish[],
|
|
||||||
swap: string,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<PopulatedTransaction>;
|
): Promise<PopulatedTransaction>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,394 +0,0 @@
|
|||||||
/* Autogenerated file. Do not edit manually. */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type {
|
|
||||||
BaseContract,
|
|
||||||
BigNumber,
|
|
||||||
BigNumberish,
|
|
||||||
BytesLike,
|
|
||||||
CallOverrides,
|
|
||||||
ContractTransaction,
|
|
||||||
Overrides,
|
|
||||||
PopulatedTransaction,
|
|
||||||
Signer,
|
|
||||||
utils,
|
|
||||||
} from "ethers";
|
|
||||||
import type {
|
|
||||||
FunctionFragment,
|
|
||||||
Result,
|
|
||||||
EventFragment,
|
|
||||||
} from "@ethersproject/abi";
|
|
||||||
import type { Listener, Provider } from "@ethersproject/providers";
|
|
||||||
import type {
|
|
||||||
TypedEventFilter,
|
|
||||||
TypedEvent,
|
|
||||||
TypedListener,
|
|
||||||
OnEvent,
|
|
||||||
} from "./common";
|
|
||||||
|
|
||||||
export interface SwapAbiInterface extends utils.Interface {
|
|
||||||
functions: {
|
|
||||||
"DURATION()": FunctionFragment;
|
|
||||||
"initialLiquidity()": FunctionFragment;
|
|
||||||
"liquidity()": FunctionFragment;
|
|
||||||
"miner()": FunctionFragment;
|
|
||||||
"poolWeight()": FunctionFragment;
|
|
||||||
"resolve(bytes32)": FunctionFragment;
|
|
||||||
"startTimestamp()": FunctionFragment;
|
|
||||||
"tokensSold()": FunctionFragment;
|
|
||||||
"torn()": FunctionFragment;
|
|
||||||
"swap(address,uint256)": FunctionFragment;
|
|
||||||
"getExpectedReturn(uint256)": FunctionFragment;
|
|
||||||
"tornVirtualBalance()": FunctionFragment;
|
|
||||||
"setPoolWeight(uint256)": FunctionFragment;
|
|
||||||
};
|
|
||||||
|
|
||||||
getFunction(
|
|
||||||
nameOrSignatureOrTopic:
|
|
||||||
| "DURATION"
|
|
||||||
| "initialLiquidity"
|
|
||||||
| "liquidity"
|
|
||||||
| "miner"
|
|
||||||
| "poolWeight"
|
|
||||||
| "resolve"
|
|
||||||
| "startTimestamp"
|
|
||||||
| "tokensSold"
|
|
||||||
| "torn"
|
|
||||||
| "swap"
|
|
||||||
| "getExpectedReturn"
|
|
||||||
| "tornVirtualBalance"
|
|
||||||
| "setPoolWeight"
|
|
||||||
): FunctionFragment;
|
|
||||||
|
|
||||||
encodeFunctionData(functionFragment: "DURATION", values?: undefined): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "initialLiquidity",
|
|
||||||
values?: undefined
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(functionFragment: "liquidity", values?: undefined): string;
|
|
||||||
encodeFunctionData(functionFragment: "miner", values?: undefined): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "poolWeight",
|
|
||||||
values?: undefined
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(functionFragment: "resolve", values: [BytesLike]): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "startTimestamp",
|
|
||||||
values?: undefined
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "tokensSold",
|
|
||||||
values?: undefined
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(functionFragment: "torn", values?: undefined): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "swap",
|
|
||||||
values: [string, BigNumberish]
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "getExpectedReturn",
|
|
||||||
values: [BigNumberish]
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "tornVirtualBalance",
|
|
||||||
values?: undefined
|
|
||||||
): string;
|
|
||||||
encodeFunctionData(
|
|
||||||
functionFragment: "setPoolWeight",
|
|
||||||
values: [BigNumberish]
|
|
||||||
): string;
|
|
||||||
|
|
||||||
decodeFunctionResult(functionFragment: "DURATION", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(
|
|
||||||
functionFragment: "initialLiquidity",
|
|
||||||
data: BytesLike
|
|
||||||
): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "liquidity", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "miner", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "poolWeight", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "resolve", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(
|
|
||||||
functionFragment: "startTimestamp",
|
|
||||||
data: BytesLike
|
|
||||||
): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "tokensSold", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "torn", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(functionFragment: "swap", data: BytesLike): Result;
|
|
||||||
decodeFunctionResult(
|
|
||||||
functionFragment: "getExpectedReturn",
|
|
||||||
data: BytesLike
|
|
||||||
): Result;
|
|
||||||
decodeFunctionResult(
|
|
||||||
functionFragment: "tornVirtualBalance",
|
|
||||||
data: BytesLike
|
|
||||||
): Result;
|
|
||||||
decodeFunctionResult(
|
|
||||||
functionFragment: "setPoolWeight",
|
|
||||||
data: BytesLike
|
|
||||||
): Result;
|
|
||||||
|
|
||||||
events: {
|
|
||||||
"PoolWeightUpdated(uint256)": EventFragment;
|
|
||||||
"Swap(address,uint256,uint256)": EventFragment;
|
|
||||||
};
|
|
||||||
|
|
||||||
getEvent(nameOrSignatureOrTopic: "PoolWeightUpdated"): EventFragment;
|
|
||||||
getEvent(nameOrSignatureOrTopic: "Swap"): EventFragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PoolWeightUpdatedEventObject {
|
|
||||||
newWeight: BigNumber;
|
|
||||||
}
|
|
||||||
export type PoolWeightUpdatedEvent = TypedEvent<
|
|
||||||
[BigNumber],
|
|
||||||
PoolWeightUpdatedEventObject
|
|
||||||
>;
|
|
||||||
|
|
||||||
export type PoolWeightUpdatedEventFilter =
|
|
||||||
TypedEventFilter<PoolWeightUpdatedEvent>;
|
|
||||||
|
|
||||||
export interface SwapEventObject {
|
|
||||||
recipient: string;
|
|
||||||
pTORN: BigNumber;
|
|
||||||
TORN: BigNumber;
|
|
||||||
}
|
|
||||||
export type SwapEvent = TypedEvent<
|
|
||||||
[string, BigNumber, BigNumber],
|
|
||||||
SwapEventObject
|
|
||||||
>;
|
|
||||||
|
|
||||||
export type SwapEventFilter = TypedEventFilter<SwapEvent>;
|
|
||||||
|
|
||||||
export interface SwapAbi extends BaseContract {
|
|
||||||
connect(signerOrProvider: Signer | Provider | string): this;
|
|
||||||
attach(addressOrName: string): this;
|
|
||||||
deployed(): Promise<this>;
|
|
||||||
|
|
||||||
interface: SwapAbiInterface;
|
|
||||||
|
|
||||||
queryFilter<TEvent extends TypedEvent>(
|
|
||||||
event: TypedEventFilter<TEvent>,
|
|
||||||
fromBlockOrBlockhash?: string | number | undefined,
|
|
||||||
toBlock?: string | number | undefined
|
|
||||||
): Promise<Array<TEvent>>;
|
|
||||||
|
|
||||||
listeners<TEvent extends TypedEvent>(
|
|
||||||
eventFilter?: TypedEventFilter<TEvent>
|
|
||||||
): Array<TypedListener<TEvent>>;
|
|
||||||
listeners(eventName?: string): Array<Listener>;
|
|
||||||
removeAllListeners<TEvent extends TypedEvent>(
|
|
||||||
eventFilter: TypedEventFilter<TEvent>
|
|
||||||
): this;
|
|
||||||
removeAllListeners(eventName?: string): this;
|
|
||||||
off: OnEvent<this>;
|
|
||||||
on: OnEvent<this>;
|
|
||||||
once: OnEvent<this>;
|
|
||||||
removeListener: OnEvent<this>;
|
|
||||||
|
|
||||||
functions: {
|
|
||||||
DURATION(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
initialLiquidity(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
liquidity(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
miner(overrides?: CallOverrides): Promise<[string]>;
|
|
||||||
|
|
||||||
poolWeight(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<[string]>;
|
|
||||||
|
|
||||||
startTimestamp(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
tokensSold(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
torn(overrides?: CallOverrides): Promise<[string]>;
|
|
||||||
|
|
||||||
swap(
|
|
||||||
recipient: string,
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<ContractTransaction>;
|
|
||||||
|
|
||||||
getExpectedReturn(
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
tornVirtualBalance(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
||||||
|
|
||||||
setPoolWeight(
|
|
||||||
newWeight: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<ContractTransaction>;
|
|
||||||
};
|
|
||||||
|
|
||||||
DURATION(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
initialLiquidity(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
liquidity(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
miner(overrides?: CallOverrides): Promise<string>;
|
|
||||||
|
|
||||||
poolWeight(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<string>;
|
|
||||||
|
|
||||||
startTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
tokensSold(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
torn(overrides?: CallOverrides): Promise<string>;
|
|
||||||
|
|
||||||
swap(
|
|
||||||
recipient: string,
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<ContractTransaction>;
|
|
||||||
|
|
||||||
getExpectedReturn(
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber>;
|
|
||||||
|
|
||||||
tornVirtualBalance(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
setPoolWeight(
|
|
||||||
newWeight: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<ContractTransaction>;
|
|
||||||
|
|
||||||
callStatic: {
|
|
||||||
DURATION(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
initialLiquidity(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
liquidity(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
miner(overrides?: CallOverrides): Promise<string>;
|
|
||||||
|
|
||||||
poolWeight(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<string>;
|
|
||||||
|
|
||||||
startTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
tokensSold(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
torn(overrides?: CallOverrides): Promise<string>;
|
|
||||||
|
|
||||||
swap(
|
|
||||||
recipient: string,
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<void>;
|
|
||||||
|
|
||||||
getExpectedReturn(
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber>;
|
|
||||||
|
|
||||||
tornVirtualBalance(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
setPoolWeight(
|
|
||||||
newWeight: BigNumberish,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<void>;
|
|
||||||
};
|
|
||||||
|
|
||||||
filters: {
|
|
||||||
"PoolWeightUpdated(uint256)"(
|
|
||||||
newWeight?: null
|
|
||||||
): PoolWeightUpdatedEventFilter;
|
|
||||||
PoolWeightUpdated(newWeight?: null): PoolWeightUpdatedEventFilter;
|
|
||||||
|
|
||||||
"Swap(address,uint256,uint256)"(
|
|
||||||
recipient?: string | null,
|
|
||||||
pTORN?: null,
|
|
||||||
TORN?: null
|
|
||||||
): SwapEventFilter;
|
|
||||||
Swap(recipient?: string | null, pTORN?: null, TORN?: null): SwapEventFilter;
|
|
||||||
};
|
|
||||||
|
|
||||||
estimateGas: {
|
|
||||||
DURATION(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
initialLiquidity(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
liquidity(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
miner(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
poolWeight(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
resolve(node: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
startTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
tokensSold(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
torn(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
swap(
|
|
||||||
recipient: string,
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<BigNumber>;
|
|
||||||
|
|
||||||
getExpectedReturn(
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<BigNumber>;
|
|
||||||
|
|
||||||
tornVirtualBalance(overrides?: CallOverrides): Promise<BigNumber>;
|
|
||||||
|
|
||||||
setPoolWeight(
|
|
||||||
newWeight: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<BigNumber>;
|
|
||||||
};
|
|
||||||
|
|
||||||
populateTransaction: {
|
|
||||||
DURATION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
initialLiquidity(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
liquidity(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
miner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
poolWeight(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
resolve(
|
|
||||||
node: BytesLike,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
startTimestamp(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
tokensSold(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
torn(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
swap(
|
|
||||||
recipient: string,
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
getExpectedReturn(
|
|
||||||
amount: BigNumberish,
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
tornVirtualBalance(
|
|
||||||
overrides?: CallOverrides
|
|
||||||
): Promise<PopulatedTransaction>;
|
|
||||||
|
|
||||||
setPoolWeight(
|
|
||||||
newWeight: BigNumberish,
|
|
||||||
overrides?: Overrides & { from?: string | Promise<string> }
|
|
||||||
): Promise<PopulatedTransaction>;
|
|
||||||
};
|
|
||||||
}
|
|
@ -10,107 +10,198 @@ const _abi = [
|
|||||||
{
|
{
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
internalType: "bytes32[]",
|
internalType: "contract MultiWrapper",
|
||||||
name: "domains",
|
name: "_multiWrapper",
|
||||||
type: "bytes32[]",
|
type: "address",
|
||||||
},
|
},
|
||||||
],
|
|
||||||
name: "bulkResolve",
|
|
||||||
outputs: [
|
|
||||||
{
|
{
|
||||||
internalType: "address[]",
|
internalType: "contract IOracle[]",
|
||||||
name: "result",
|
name: "existingOracles",
|
||||||
type: "address[]",
|
type: "address[]",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
internalType: "enum OffchainOracle.OracleType[]",
|
||||||
|
name: "oracleTypes",
|
||||||
|
type: "uint8[]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internalType: "contract IERC20[]",
|
||||||
|
name: "existingConnectors",
|
||||||
|
type: "address[]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internalType: "contract IERC20",
|
||||||
|
name: "wBase",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
stateMutability: "nonpayable",
|
stateMutability: "nonpayable",
|
||||||
|
type: "constructor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
indexed: false,
|
||||||
|
internalType: "contract IERC20",
|
||||||
|
name: "connector",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "ConnectorAdded",
|
||||||
|
type: "event",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
indexed: false,
|
||||||
|
internalType: "contract IERC20",
|
||||||
|
name: "connector",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "ConnectorRemoved",
|
||||||
|
type: "event",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
indexed: false,
|
||||||
|
internalType: "contract MultiWrapper",
|
||||||
|
name: "multiWrapper",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "MultiWrapperUpdated",
|
||||||
|
type: "event",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
indexed: false,
|
||||||
|
internalType: "contract IOracle",
|
||||||
|
name: "oracle",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
indexed: false,
|
||||||
|
internalType: "enum OffchainOracle.OracleType",
|
||||||
|
name: "oracleType",
|
||||||
|
type: "uint8",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "OracleAdded",
|
||||||
|
type: "event",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
indexed: false,
|
||||||
|
internalType: "contract IOracle",
|
||||||
|
name: "oracle",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
indexed: false,
|
||||||
|
internalType: "enum OffchainOracle.OracleType",
|
||||||
|
name: "oracleType",
|
||||||
|
type: "uint8",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "OracleRemoved",
|
||||||
|
type: "event",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
indexed: true,
|
||||||
|
internalType: "address",
|
||||||
|
name: "previousOwner",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
indexed: true,
|
||||||
|
internalType: "address",
|
||||||
|
name: "newOwner",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "OwnershipTransferred",
|
||||||
|
type: "event",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
internalType: "contract IERC20",
|
||||||
|
name: "connector",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "addConnector",
|
||||||
|
outputs: [],
|
||||||
|
stateMutability: "nonpayable",
|
||||||
type: "function",
|
type: "function",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
internalType: "contract Governance",
|
internalType: "contract IOracle",
|
||||||
name: "governance",
|
name: "oracle",
|
||||||
type: "address",
|
type: "address",
|
||||||
},
|
},
|
||||||
],
|
|
||||||
name: "getAllProposals",
|
|
||||||
outputs: [
|
|
||||||
{
|
{
|
||||||
components: [
|
internalType: "enum OffchainOracle.OracleType",
|
||||||
{
|
name: "oracleKind",
|
||||||
internalType: "address",
|
type: "uint8",
|
||||||
name: "proposer",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "address",
|
|
||||||
name: "target",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "startTime",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "endTime",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "forVotes",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "againstVotes",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "bool",
|
|
||||||
name: "executed",
|
|
||||||
type: "bool",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "bool",
|
|
||||||
name: "extended",
|
|
||||||
type: "bool",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "enum Governance.ProposalState",
|
|
||||||
name: "state",
|
|
||||||
type: "uint8",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
internalType: "struct GovernanceAggregator.Proposal[]",
|
|
||||||
name: "proposals",
|
|
||||||
type: "tuple[]",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
stateMutability: "view",
|
name: "addOracle",
|
||||||
|
outputs: [],
|
||||||
|
stateMutability: "nonpayable",
|
||||||
type: "function",
|
type: "function",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
inputs: [
|
inputs: [],
|
||||||
|
name: "connectors",
|
||||||
|
outputs: [
|
||||||
{
|
{
|
||||||
internalType: "contract Governance",
|
internalType: "contract IERC20[]",
|
||||||
name: "governance",
|
name: "allConnectors",
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "address[]",
|
|
||||||
name: "accs",
|
|
||||||
type: "address[]",
|
type: "address[]",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: "getGovernanceBalances",
|
stateMutability: "view",
|
||||||
|
type: "function",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
internalType: "contract IERC20",
|
||||||
|
name: "srcToken",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internalType: "contract IERC20",
|
||||||
|
name: "dstToken",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internalType: "bool",
|
||||||
|
name: "useWrappers",
|
||||||
|
type: "bool",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "getRate",
|
||||||
outputs: [
|
outputs: [
|
||||||
{
|
{
|
||||||
internalType: "uint256[]",
|
internalType: "uint256",
|
||||||
name: "amounts",
|
name: "weightedRate",
|
||||||
type: "uint256[]",
|
type: "uint256",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
stateMutability: "view",
|
stateMutability: "view",
|
||||||
@ -119,104 +210,61 @@ const _abi = [
|
|||||||
{
|
{
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
internalType: "address[]",
|
internalType: "contract IERC20",
|
||||||
name: "fromTokens",
|
name: "srcToken",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internalType: "bool",
|
||||||
|
name: "useSrcWrappers",
|
||||||
|
type: "bool",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: "getRateToEth",
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
internalType: "uint256",
|
||||||
|
name: "weightedRate",
|
||||||
|
type: "uint256",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
stateMutability: "view",
|
||||||
|
type: "function",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
inputs: [],
|
||||||
|
name: "multiWrapper",
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
internalType: "contract MultiWrapper",
|
||||||
|
name: "",
|
||||||
|
type: "address",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
stateMutability: "view",
|
||||||
|
type: "function",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
inputs: [],
|
||||||
|
name: "oracles",
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
internalType: "contract IOracle[]",
|
||||||
|
name: "allOracles",
|
||||||
type: "address[]",
|
type: "address[]",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
internalType: "uint256[]",
|
internalType: "enum OffchainOracle.OracleType[]",
|
||||||
name: "oneUnitAmounts",
|
name: "oracleTypes",
|
||||||
type: "uint256[]",
|
type: "uint8[]",
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "getPricesInETH",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256[]",
|
|
||||||
name: "prices",
|
|
||||||
type: "uint256[]",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
stateMutability: "view",
|
stateMutability: "view",
|
||||||
type: "function",
|
type: "function",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
inputs: [
|
inputs: [],
|
||||||
{
|
name: "owner",
|
||||||
internalType: "contract Governance",
|
|
||||||
name: "governance",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "address",
|
|
||||||
name: "account",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "getUserData",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "balance",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "latestProposalId",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "latestProposalIdState",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "timelock",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "address",
|
|
||||||
name: "delegatee",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: "contract Miner",
|
|
||||||
name: "miner",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "address[]",
|
|
||||||
name: "instances",
|
|
||||||
type: "address[]",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "minerRates",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256[]",
|
|
||||||
name: "_rates",
|
|
||||||
type: "uint256[]",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: "bytes32",
|
|
||||||
name: "node",
|
|
||||||
type: "bytes32",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "resolve",
|
|
||||||
outputs: [
|
outputs: [
|
||||||
{
|
{
|
||||||
internalType: "address",
|
internalType: "address",
|
||||||
@ -230,98 +278,65 @@ const _abi = [
|
|||||||
{
|
{
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
internalType: "contract RewardSwap",
|
internalType: "contract IERC20",
|
||||||
name: "swap",
|
name: "connector",
|
||||||
type: "address",
|
type: "address",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: "swapState",
|
name: "removeConnector",
|
||||||
outputs: [
|
outputs: [],
|
||||||
{
|
stateMutability: "nonpayable",
|
||||||
internalType: "uint256",
|
|
||||||
name: "balance",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "poolWeight",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
type: "function",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
internalType: "contract Miner",
|
internalType: "contract IOracle",
|
||||||
name: "miner",
|
name: "oracle",
|
||||||
type: "address",
|
type: "address",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
internalType: "address[]",
|
internalType: "enum OffchainOracle.OracleType",
|
||||||
name: "instances",
|
name: "oracleKind",
|
||||||
type: "address[]",
|
type: "uint8",
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "contract RewardSwap",
|
|
||||||
name: "swap",
|
|
||||||
type: "address",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: "miningData",
|
name: "removeOracle",
|
||||||
outputs: [
|
outputs: [],
|
||||||
{
|
stateMutability: "nonpayable",
|
||||||
internalType: "uint256[]",
|
type: "function",
|
||||||
name: "_rates",
|
},
|
||||||
type: "uint256[]",
|
{
|
||||||
},
|
inputs: [],
|
||||||
{
|
name: "renounceOwnership",
|
||||||
internalType: "uint256",
|
outputs: [],
|
||||||
name: "balance",
|
stateMutability: "nonpayable",
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "poolWeight",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
type: "function",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
internalType: "address[]",
|
internalType: "contract MultiWrapper",
|
||||||
name: "fromTokens",
|
name: "_multiWrapper",
|
||||||
type: "address[]",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256[]",
|
|
||||||
name: "oneUnitAmounts",
|
|
||||||
type: "uint256[]",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "contract RewardSwap",
|
|
||||||
name: "swap",
|
|
||||||
type: "address",
|
type: "address",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: "marketData",
|
name: "setMultiWrapper",
|
||||||
outputs: [
|
outputs: [],
|
||||||
|
stateMutability: "nonpayable",
|
||||||
|
type: "function",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
inputs: [
|
||||||
{
|
{
|
||||||
internalType: "uint256[]",
|
internalType: "address",
|
||||||
name: "prices",
|
name: "newOwner",
|
||||||
type: "uint256[]",
|
type: "address",
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "balance",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
stateMutability: "view",
|
name: "transferOwnership",
|
||||||
|
outputs: [],
|
||||||
|
stateMutability: "nonpayable",
|
||||||
type: "function",
|
type: "function",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -1,273 +0,0 @@
|
|||||||
/* Autogenerated file. Do not edit manually. */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
import { Contract, Signer, utils } from "ethers";
|
|
||||||
import type { Provider } from "@ethersproject/providers";
|
|
||||||
import type { SwapAbi, SwapAbiInterface } from "../SwapAbi";
|
|
||||||
|
|
||||||
const _abi = [
|
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: "bytes32",
|
|
||||||
name: "_torn",
|
|
||||||
type: "bytes32",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "bytes32",
|
|
||||||
name: "_miner",
|
|
||||||
type: "bytes32",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "_miningCap",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "_initialLiquidity",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "nonpayable",
|
|
||||||
type: "constructor",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
anonymous: false,
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
indexed: false,
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "newWeight",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "PoolWeightUpdated",
|
|
||||||
type: "event",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
anonymous: false,
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
indexed: true,
|
|
||||||
internalType: "address",
|
|
||||||
name: "recipient",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
indexed: false,
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "pTORN",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
indexed: false,
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "TORN",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "Swap",
|
|
||||||
type: "event",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "DURATION",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "initialLiquidity",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "liquidity",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "miner",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "address",
|
|
||||||
name: "",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "poolWeight",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: "bytes32",
|
|
||||||
name: "node",
|
|
||||||
type: "bytes32",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "resolve",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "address",
|
|
||||||
name: "",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "startTimestamp",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "tokensSold",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "torn",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "contract IERC20",
|
|
||||||
name: "",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: "address",
|
|
||||||
name: "recipient",
|
|
||||||
type: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "amount",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "swap",
|
|
||||||
outputs: [],
|
|
||||||
stateMutability: "nonpayable",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "amount",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "getExpectedReturn",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [],
|
|
||||||
name: "tornVirtualBalance",
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: "view",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: "uint256",
|
|
||||||
name: "newWeight",
|
|
||||||
type: "uint256",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: "setPoolWeight",
|
|
||||||
outputs: [],
|
|
||||||
stateMutability: "nonpayable",
|
|
||||||
type: "function",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export class SwapAbi__factory {
|
|
||||||
static readonly abi = _abi;
|
|
||||||
static createInterface(): SwapAbiInterface {
|
|
||||||
return new utils.Interface(_abi) as SwapAbiInterface;
|
|
||||||
}
|
|
||||||
static connect(
|
|
||||||
address: string,
|
|
||||||
signerOrProvider: Signer | Provider
|
|
||||||
): SwapAbi {
|
|
||||||
return new Contract(address, _abi, signerOrProvider) as SwapAbi;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +1,17 @@
|
|||||||
/* Autogenerated file. Do not edit manually. */
|
/* Autogenerated file. Do not edit manually. */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type { AggregatorAbi } from "./AggregatorAbi";
|
export type { AggregatorAbi } from './AggregatorAbi';
|
||||||
export type { MulticallAbi } from "./MulticallAbi";
|
export type { MulticallAbi } from './MulticallAbi';
|
||||||
export type { OffchainOracleAbi } from "./OffchainOracleAbi";
|
export type { OffchainOracleAbi } from './OffchainOracleAbi';
|
||||||
export type { MiningAbi } from "./MiningAbi";
|
export type { ProxyLightABI } from './ProxyLightABI';
|
||||||
export type { ProxyLightABI } from "./ProxyLightABI";
|
export type { TornadoABI } from './TornadoABI';
|
||||||
export type { SwapAbi } from "./SwapAbi";
|
export type { TornadoProxyABI } from './TornadoProxyABI';
|
||||||
export type { TornadoABI } from "./TornadoABI";
|
export * as factories from './factories';
|
||||||
export type { TornadoProxyABI } from "./TornadoProxyABI";
|
export { AggregatorAbi__factory } from './factories/AggregatorAbi__factory';
|
||||||
export * as factories from "./factories";
|
export { MiningAbi__factory } from './factories/MiningAbi__factory';
|
||||||
export { AggregatorAbi__factory } from "./factories/AggregatorAbi__factory";
|
export { MulticallAbi__factory } from './factories/MulticallAbi__factory';
|
||||||
export { MiningAbi__factory } from "./factories/MiningAbi__factory";
|
export { OffchainOracleAbi__factory } from './factories/OffchainOracleAbi__factory';
|
||||||
export { MulticallAbi__factory } from "./factories/MulticallAbi__factory";
|
export { ProxyLightABI__factory } from './factories/ProxyLightABI__factory';
|
||||||
export { OffchainOracleAbi__factory } from "./factories/OffchainOracleAbi__factory";
|
export { TornadoABI__factory } from './factories/TornadoABI__factory';
|
||||||
export { ProxyLightABI__factory } from "./factories/ProxyLightABI__factory";
|
export { TornadoProxyABI__factory } from './factories/TornadoProxyABI__factory';
|
||||||
export { SwapAbi__factory } from "./factories/SwapAbi__factory";
|
|
||||||
export { TornadoABI__factory } from "./factories/TornadoABI__factory";
|
|
||||||
export { TornadoProxyABI__factory } from "./factories/TornadoProxyABI__factory";
|
|
||||||
|
647134
keys/TreeUpdate.json
647134
keys/TreeUpdate.json
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -20,7 +20,6 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bullmq": "^1.80.6",
|
"bullmq": "^1.80.6",
|
||||||
"circomlib": "git+https://github.com/tornadocash/circomlib.git#3b492f9801573eebcfe1b6c584afe8a3beecf2b4",
|
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"eth-ens-namehash": "^2.0.8",
|
"eth-ens-namehash": "^2.0.8",
|
||||||
"ethers": "^5.6.4",
|
"ethers": "^5.6.4",
|
||||||
@ -32,8 +31,7 @@
|
|||||||
"json-schema-to-ts": "^2.2.0",
|
"json-schema-to-ts": "^2.2.0",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"torn-token": "link:../torn-token",
|
"torn-token": "link:../torn-token",
|
||||||
"tornado-anonymity-mining": "^2.1.2",
|
"tx-manager": "^0.4.6",
|
||||||
"tx-manager": "^0.4.1",
|
|
||||||
"uuid": "^8.3.0",
|
"uuid": "^8.3.0",
|
||||||
"web3": "^1.3.0",
|
"web3": "^1.3.0",
|
||||||
"web3-core-promievent": "^1.3.0",
|
"web3-core-promievent": "^1.3.0",
|
||||||
|
14
src/queue/index.ts
Normal file
14
src/queue/index.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { Queue, Worker } from 'bullmq';
|
||||||
|
import { redis } from '../modules';
|
||||||
|
import { priceProcessor } from './priceProcessor';
|
||||||
|
import { Token } from '../types';
|
||||||
|
import { netId } from '../config';
|
||||||
|
import { relayerProcessor } from './relayerProcessor';
|
||||||
|
|
||||||
|
const connection = redis.getClient();
|
||||||
|
|
||||||
|
export const priceQueue = new Queue<Token[], any>('price', { connection });
|
||||||
|
export const getPriceWorker = () => new Worker(priceQueue.name, priceProcessor, { connection });
|
||||||
|
|
||||||
|
export const relayerQueue = new Queue(`relayer_${netId}`, { connection });
|
||||||
|
export const getRelayerWorker = () => new Worker(relayerQueue.name, relayerProcessor, { connection });
|
@ -1,66 +0,0 @@
|
|||||||
import { getTornadoMiningContract, getTornadoProxyContract } from '../modules/contracts';
|
|
||||||
import { MiningAbi, TornadoProxyABI } from '../../contracts';
|
|
||||||
import { NewAccountEvent } from '../../contracts/MiningAbi';
|
|
||||||
import MerkleTree from 'fixed-merkle-tree';
|
|
||||||
import { minerMerkleTreeHeight, netId } from '../config';
|
|
||||||
import { poseidon } from 'circomlib';
|
|
||||||
import { BigNumber } from 'ethers';
|
|
||||||
import { readJSON } from '../modules';
|
|
||||||
|
|
||||||
const poseidonHash = (items) => BigNumber.from(poseidon(items)).toString();
|
|
||||||
const poseidonHash2 = (a, b) => poseidonHash([a, b]);
|
|
||||||
|
|
||||||
export class TreeService {
|
|
||||||
proxy: TornadoProxyABI;
|
|
||||||
miner: MiningAbi;
|
|
||||||
tree: MerkleTree;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.proxy = getTornadoProxyContract();
|
|
||||||
this.miner = getTornadoMiningContract();
|
|
||||||
}
|
|
||||||
|
|
||||||
async initTree() {
|
|
||||||
|
|
||||||
const cachedEvents = await readJSON(`../../cache/accounts_farmer_${netId}.json`);
|
|
||||||
console.log('loaded cached events', cachedEvents.length);
|
|
||||||
const cachedCommitments = cachedEvents.map(e => BigNumber.from(e.commitment).toString());
|
|
||||||
|
|
||||||
const [{ blockNumber: fromBlock }] = cachedEvents.slice(-1);
|
|
||||||
console.log('fetching new events');
|
|
||||||
const newEvents = await this.fetchEvents(fromBlock);
|
|
||||||
|
|
||||||
console.log('fetched', newEvents.length);
|
|
||||||
const newCommitments = newEvents
|
|
||||||
.sort((a, b) => a.args.index.sub(b.args.index).toNumber())
|
|
||||||
.map(e => BigNumber.from(e.args.commitment).toString())
|
|
||||||
.filter((item, index, arr) => !index || item !== arr[index - 1]);
|
|
||||||
|
|
||||||
const commitments = cachedCommitments.concat(newCommitments);
|
|
||||||
console.log(newEvents.slice(-1), commitments.slice(-1));
|
|
||||||
console.log('create tree');
|
|
||||||
this.tree = new MerkleTree(minerMerkleTreeHeight, commitments, { hashFunction: poseidonHash2 });
|
|
||||||
const rootOnContract = await this.miner.callStatic.getLastAccountRoot();
|
|
||||||
console.log(this.tree.root, BigNumber.from(rootOnContract).toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
async fetchEvents(fromBlock: number, toBlock?: number): Promise<NewAccountEvent[]> {
|
|
||||||
toBlock = toBlock ?? await this.proxy.provider.getBlockNumber();
|
|
||||||
if (fromBlock <= toBlock) {
|
|
||||||
try {
|
|
||||||
const newAccountEvent = this.miner.filters.NewAccount();
|
|
||||||
return await this.miner.queryFilter(newAccountEvent, fromBlock, toBlock);
|
|
||||||
} catch (error) {
|
|
||||||
const midBlock = (fromBlock + toBlock) >> 1;
|
|
||||||
|
|
||||||
if (midBlock - fromBlock < 2) {
|
|
||||||
throw new Error(`error fetching events: ${error.message}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await Promise.all([this.fetchEvents(fromBlock, midBlock), this.fetchEvents(midBlock + 1, toBlock)]);
|
|
||||||
return result.flat();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
7544
yarn-error.log
7544
yarn-error.log
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user