ufomarketplace-sdk-new
Version:
SDK to interact with set ufo marketplace contracts
266 lines (258 loc) • 11.9 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
import type { Provider, TransactionRequest } from "@ethersproject/providers";
import type {
TraderPlatform,
TraderPlatformInterface,
} from "../../Trader.sol/TraderPlatform";
const _abi = [
{
type: "constructor",
inputs: [
{
name: "_router",
type: "address",
internalType: "address",
},
{
name: "_token1",
type: "address",
internalType: "address",
},
{
name: "_token2",
type: "address",
internalType: "address",
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "addLiquidity",
inputs: [
{
name: "token1Amount",
type: "uint256",
internalType: "uint256",
},
{
name: "token2Amount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "getBlockStamp",
inputs: [],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "owner",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "renounceOwnership",
inputs: [],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setupTrade",
inputs: [
{
name: "token1Amount",
type: "uint256",
internalType: "uint256",
},
{
name: "token2Amount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "swapExactTokensForTokens",
inputs: [
{
name: "token1Amount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "token1",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "token2",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "transferOwnership",
inputs: [
{
name: "newOwner",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "uniswapV2Pair",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "uniswapV2Router",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "contract IUniswapV2Router02",
},
],
stateMutability: "view",
},
{
type: "event",
name: "OwnershipTransferred",
inputs: [
{
name: "previousOwner",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "newOwner",
type: "address",
indexed: true,
internalType: "address",
},
],
anonymous: false,
},
] as const;
const _bytecode =
"0x608060405234801561001057600080fd5b50604051610c34380380610c3483398101604081905261002f916100e6565b6100383361007a565b600180546001600160a01b039485166001600160a01b031991821617909155600380549385169382169390931790925560048054919093169116179055610129565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100e157600080fd5b919050565b6000806000606084860312156100fb57600080fd5b610104846100ca565b9250610112602085016100ca565b9150610120604085016100ca565b90509250925092565b610afc806101386000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80638da5cb5b116100715780638da5cb5b146101215780638f80e099146101325780639cd441da14610145578063d21220a714610158578063d902ffb01461016b578063f2fde38b1461017957600080fd5b80631694505e146100ae57806325be124e146100de57806349bd5a5e146100f157806370f507c714610104578063715018a614610119575b600080fd5b6001546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6004546100c1906001600160a01b031681565b6002546100c1906001600160a01b031681565b6101176101123660046109dd565b61018c565b005b610117610551565b6000546001600160a01b03166100c1565b6101176101403660046109c4565b610565565b6101176101533660046109dd565b6106e7565b6003546100c1906001600160a01b031681565b6040514281526020016100d5565b610117610187366004610961565b610839565b6101946108b7565b60035460015460405163095ea7b360e01b81526001600160a01b0391821660048201526024810185905291169063095ea7b390604401602060405180830381600087803b1580156101e457600080fd5b505af11580156101f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021c91906109a2565b506004805460015460405163095ea7b360e01b81526001600160a01b039182169381019390935260248301849052169063095ea7b390604401602060405180830381600087803b15801561026f57600080fd5b505af1158015610283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a791906109a2565b50600160009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156102f657600080fd5b505afa15801561030a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032e9190610985565b600354600480546040516364e329cb60e11b81526001600160a01b03938416928101929092528216602482015291169063c9c6539690604401602060405180830381600087803b15801561038157600080fd5b505af1158015610395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b99190610985565b600280546001600160a01b039283166001600160a01b03199091161790556001546003546004549183169263e8e3370092918116911685856000806104066000546001600160a01b031690565b610411426005610a9e565b60405160e08a901b6001600160e01b03191681526001600160a01b039889166004820152968816602488015260448701959095526064860193909352608485019190915260a484015290921660c482015260e481019190915261010401606060405180830381600087803b15801561048857600080fd5b505af115801561049c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c091906109ff565b505060025460015460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054c91906109a2565b505050565b6105596108b7565b6105636000610911565b565b6003546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401602060405180830381600087803b1580156105b757600080fd5b505af11580156105cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ef91906109a2565b50604080516002808252606082018352600092602083019080368337505060035482519293506001600160a01b03169183915060009061063157610631610ac4565b6001600160a01b03928316602091820292909201015260045482519116908290600190811061066257610662610ac4565b6001600160a01b03928316602091820292909201015260015416635c11d7958360008433610691426005610a9e565b6040518663ffffffff1660e01b81526004016106b1959493929190610a2d565b600060405180830381600087803b1580156106cb57600080fd5b505af11580156106df573d6000803e3d6000fd5b505050505050565b6106ef6108b7565b60035460015460405163095ea7b360e01b81526001600160a01b0391821660048201526024810185905291169063095ea7b390604401602060405180830381600087803b15801561073f57600080fd5b505af1158015610753573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077791906109a2565b506004805460015460405163095ea7b360e01b81526001600160a01b039182169381019390935260248301849052169063095ea7b390604401602060405180830381600087803b1580156107ca57600080fd5b505af11580156107de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080291906109a2565b506001546003546004546001600160a01b039283169263e8e33700928116911685856000806104066000546001600160a01b031690565b6108416108b7565b6001600160a01b0381166108ab5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6108b481610911565b50565b6000546001600160a01b031633146105635760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108a2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561097357600080fd5b813561097e81610ada565b9392505050565b60006020828403121561099757600080fd5b815161097e81610ada565b6000602082840312156109b457600080fd5b8151801515811461097e57600080fd5b6000602082840312156109d657600080fd5b5035919050565b600080604083850312156109f057600080fd5b50508035926020909101359150565b600080600060608486031215610a1457600080fd5b8351925060208401519150604084015190509250925092565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015610a7d5784516001600160a01b031683529383019391830191600101610a58565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115610abf57634e487b7160e01b600052601160045260246000fd5b500190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146108b457600080fdfea164736f6c6343000807000a";
type TraderPlatformConstructorParams =
| [signer?: Signer]
| ConstructorParameters<typeof ContractFactory>;
const isSuperArgs = (
xs: TraderPlatformConstructorParams
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
export class TraderPlatform__factory extends ContractFactory {
constructor(...args: TraderPlatformConstructorParams) {
if (isSuperArgs(args)) {
super(...args);
} else {
super(_abi, _bytecode, args[0]);
}
}
override deploy(
_router: string,
_token1: string,
_token2: string,
overrides?: Overrides & { from?: string }
): Promise<TraderPlatform> {
return super.deploy(
_router,
_token1,
_token2,
overrides || {}
) as Promise<TraderPlatform>;
}
override getDeployTransaction(
_router: string,
_token1: string,
_token2: string,
overrides?: Overrides & { from?: string }
): TransactionRequest {
return super.getDeployTransaction(
_router,
_token1,
_token2,
overrides || {}
);
}
override attach(address: string): TraderPlatform {
return super.attach(address) as TraderPlatform;
}
override connect(signer: Signer): TraderPlatform__factory {
return super.connect(signer) as TraderPlatform__factory;
}
static readonly bytecode = _bytecode;
static readonly abi = _abi;
static createInterface(): TraderPlatformInterface {
return new utils.Interface(_abi) as TraderPlatformInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): TraderPlatform {
return new Contract(address, _abi, signerOrProvider) as TraderPlatform;
}
}