Last active
December 6, 2020 08:43
-
-
Save pironmind/713910d63fc5f828c838abfe43d96e2f to your computer and use it in GitHub Desktop.
IJustswapExchange missing ABI, Justswap Exchange Interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"name": "buyer", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"name": "trx_sold", | |
"type": "uint256" | |
}, | |
{ | |
"indexed": true, | |
"name": "tokens_bought", | |
"type": "uint256" | |
} | |
], | |
"name": "TokenPurchase", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"name": "buyer", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"name": "tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"indexed": true, | |
"name": "trx_bought", | |
"type": "uint256" | |
} | |
], | |
"name": "TrxPurchase", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"name": "provider", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"name": "trx_amount", | |
"type": "uint256" | |
}, | |
{ | |
"indexed": true, | |
"name": "token_amount", | |
"type": "uint256" | |
} | |
], | |
"name": "AddLiquidity", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"name": "provider", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"name": "trx_amount", | |
"type": "uint256" | |
}, | |
{ | |
"indexed": true, | |
"name": "token_amount", | |
"type": "uint256" | |
} | |
], | |
"name": "RemoveLiquidity", | |
"type": "event" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"name": "input_amount", | |
"type": "uint256" | |
}, | |
{ | |
"name": "input_reserve", | |
"type": "uint256" | |
}, | |
{ | |
"name": "output_reserve", | |
"type": "uint256" | |
} | |
], | |
"name": "getInputPrice", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"name": "output_amount", | |
"type": "uint256" | |
}, | |
{ | |
"name": "input_reserve", | |
"type": "uint256" | |
}, | |
{ | |
"name": "output_reserve", | |
"type": "uint256" | |
} | |
], | |
"name": "getOutputPrice", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "min_tokens", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
} | |
], | |
"name": "trxToTokenSwapInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": true, | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "min_tokens", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
} | |
], | |
"name": "trxToTokenTransferInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": true, | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
} | |
], | |
"name": "trxToTokenSwapOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": true, | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
} | |
], | |
"name": "trxToTokenTransferOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": true, | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_trx", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
} | |
], | |
"name": "tokenToTrxSwapInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_trx", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
} | |
], | |
"name": "tokenToTrxTransferInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "trx_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_tokens", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
} | |
], | |
"name": "tokenToTrxSwapOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "trx_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_tokens", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
} | |
], | |
"name": "tokenToTrxTransferOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_trx_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "token_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToTokenSwapInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_trx_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
}, | |
{ | |
"name": "token_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToTokenTransferInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_trx_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "token_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToTokenSwapOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_trx_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
}, | |
{ | |
"name": "token_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToTokenTransferOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_trx_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "exchange_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToExchangeSwapInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_trx_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
}, | |
{ | |
"name": "exchange_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToExchangeTransferInput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_trx_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "exchange_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToExchangeSwapOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "tokens_bought", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_tokens_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_trx_sold", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"name": "recipient", | |
"type": "address" | |
}, | |
{ | |
"name": "exchange_addr", | |
"type": "address" | |
} | |
], | |
"name": "tokenToExchangeTransferOutput", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"name": "trx_sold", | |
"type": "uint256" | |
} | |
], | |
"name": "getTrxToTokenInputPrice", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"name": "tokens_bought", | |
"type": "uint256" | |
} | |
], | |
"name": "getTrxToTokenOutputPrice", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"name": "tokens_sold", | |
"type": "uint256" | |
} | |
], | |
"name": "getTokenToTrxInputPrice", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"name": "trx_bought", | |
"type": "uint256" | |
} | |
], | |
"name": "getTokenToTrxOutputPrice", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [], | |
"name": "tokenAddress", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "address" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [], | |
"name": "factoryAddress", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "address" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "min_liquidity", | |
"type": "uint256" | |
}, | |
{ | |
"name": "max_tokens", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
} | |
], | |
"name": "addLiquidity", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": true, | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "amount", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_trx", | |
"type": "uint256" | |
}, | |
{ | |
"name": "min_tokens", | |
"type": "uint256" | |
}, | |
{ | |
"name": "deadline", | |
"type": "uint256" | |
} | |
], | |
"name": "removeLiquidity", | |
"outputs": [ | |
{ | |
"name": "", | |
"type": "uint256" | |
}, | |
{ | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.5.10; | |
interface IJustswapExchange { | |
event TokenPurchase(address indexed buyer, uint256 indexed trx_sold, uint256 indexed tokens_bought); | |
event TrxPurchase(address indexed buyer, uint256 indexed tokens_sold, uint256 indexed trx_bought); | |
event AddLiquidity(address indexed provider, uint256 indexed trx_amount, uint256 indexed token_amount); | |
event RemoveLiquidity(address indexed provider, uint256 indexed trx_amount, uint256 indexed token_amount); | |
function getInputPrice( | |
uint256 input_amount, | |
uint256 input_reserve, | |
uint256 output_reserve | |
) external view returns (uint256); | |
function getOutputPrice( | |
uint256 output_amount, | |
uint256 input_reserve, | |
uint256 output_reserve | |
) external view returns (uint256); | |
function trxToTokenSwapInput( | |
uint256 min_tokens, | |
uint256 deadline | |
) external payable returns (uint256); | |
function trxToTokenTransferInput( | |
uint256 min_tokens, | |
uint256 deadline, | |
address recipient | |
) external payable returns(uint256); | |
function trxToTokenSwapOutput( | |
uint256 tokens_bought, | |
uint256 deadline | |
) external payable returns(uint256); | |
function trxToTokenTransferOutput( | |
uint256 tokens_bought, | |
uint256 deadline, | |
address recipient | |
) external payable returns (uint256); | |
function tokenToTrxSwapInput( | |
uint256 tokens_sold, | |
uint256 min_trx, | |
uint256 deadline | |
) external returns (uint256); | |
function tokenToTrxTransferInput( | |
uint256 tokens_sold, | |
uint256 min_trx, | |
uint256 deadline, | |
address recipient | |
) external returns (uint256); | |
function tokenToTrxSwapOutput( | |
uint256 trx_bought, | |
uint256 max_tokens, | |
uint256 deadline | |
) external returns (uint256); | |
function tokenToTrxTransferOutput( | |
uint256 trx_bought, | |
uint256 max_tokens, | |
uint256 deadline, | |
address recipient | |
) external returns (uint256); | |
function tokenToTokenSwapInput( | |
uint256 tokens_sold, | |
uint256 min_tokens_bought, | |
uint256 min_trx_bought, | |
uint256 deadline, | |
address token_addr | |
) external returns (uint256); | |
function tokenToTokenTransferInput( | |
uint256 tokens_sold, | |
uint256 min_tokens_bought, | |
uint256 min_trx_bought, | |
uint256 deadline, | |
address recipient, | |
address token_addr | |
) external returns (uint256); | |
function tokenToTokenSwapOutput( | |
uint256 tokens_bought, | |
uint256 max_tokens_sold, | |
uint256 max_trx_sold, | |
uint256 deadline, | |
address token_addr | |
) external returns (uint256); | |
function tokenToTokenTransferOutput( | |
uint256 tokens_bought, | |
uint256 max_tokens_sold, | |
uint256 max_trx_sold, | |
uint256 deadline, | |
address recipient, | |
address token_addr | |
) external returns (uint256); | |
function tokenToExchangeSwapInput( | |
uint256 tokens_sold, | |
uint256 min_tokens_bought, | |
uint256 min_trx_bought, | |
uint256 deadline, | |
address exchange_addr | |
) external returns (uint256); | |
function tokenToExchangeTransferInput( | |
uint256 tokens_sold, | |
uint256 min_tokens_bought, | |
uint256 min_trx_bought, | |
uint256 deadline, | |
address recipient, | |
address exchange_addr | |
) external returns (uint256); | |
function tokenToExchangeSwapOutput( | |
uint256 tokens_bought, | |
uint256 max_tokens_sold, | |
uint256 max_trx_sold, | |
uint256 deadline, | |
address exchange_addr | |
) external returns (uint256); | |
function tokenToExchangeTransferOutput( | |
uint256 tokens_bought, | |
uint256 max_tokens_sold, | |
uint256 max_trx_sold, | |
uint256 deadline, | |
address recipient, | |
address exchange_addr | |
) external returns (uint256); | |
function getTrxToTokenInputPrice(uint256 trx_sold) external view returns (uint256); | |
function getTrxToTokenOutputPrice(uint256 tokens_bought) external view returns (uint256); | |
function getTokenToTrxInputPrice(uint256 tokens_sold) external view returns (uint256); | |
function getTokenToTrxOutputPrice(uint256 trx_bought) external view returns (uint256); | |
function tokenAddress() external view returns (address); | |
function factoryAddress() external view returns (address); | |
function addLiquidity( | |
uint256 min_liquidity, | |
uint256 max_tokens, | |
uint256 deadline | |
) external payable returns (uint256); | |
function removeLiquidity( | |
uint256 amount, | |
uint256 min_trx, | |
uint256 min_tokens, | |
uint256 deadline | |
) external returns (uint256, uint256); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment