{
address: "0xe58b9e60afe16e5707376e84372fa1dfbebf71f0",
balance: {
type: "BigNumber",
hex: "0x00"
string: "0"
ether: "0.0"
},
"transactions": [],
code: "/*
Name: LiquidityPair (example: WKARMA-YO)
Version: 0.0.1
Source:
- PancakePair: https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/PancakePair.sol
- PancakeERC20: https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/PancakeERC20.sol
- PancakeRouter: https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/PancakeRouter.sol
- PancakeFactory: https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/PancakeFactory.sol
*/
class Ownable {
owner = '0x0000000000000000000000000000000000000000';
OwnershipTransferred(oldOwner, newOwner) {} // event
constructor() {
this.owner = msg.sender;
}
getOwner() {
return [this.owner];
}
transferOwnership(newOwner) {
require(newOwner != address(0), "Ownable: new owner is the zero address");
this._transferOwnership(newOwner);
}
_transferOwnership(newOwner) {
newOwner = newOwner.toLowerCase();
const oldOwner = this.owner;
this.owner = newOwner;
emit('OwnershipTransferred', [oldOwner, newOwner]);
}
_onlyOwner(next) {
require(msg.sender.toLowerCase() == this.owner, 'only owner can execute this');
next();
}
}
// Methods
Ownable.prototype.OwnershipTransferred.event = true;
Ownable.prototype.OwnershipTransferred.inputs = ['address indexed', 'address indexed'];
// Methods
Ownable.prototype.getOwner.view = true;
Ownable.prototype.getOwner.outputs = ['address'];
Ownable.prototype.transferOwnership.inputs = ['address'];
Ownable.prototype.transferOwnership.modifiers = ['_onlyOwner'];
Ownable.prototype._transferOwnership.internal = true;
Ownable.prototype._onlyOwner.internal = true;
class ERC20Token extends Ownable {
name = 'ERC20 Token';
symbol = 'ERC20';
decimals = 18;
totalSupply = number('0');
allowed = {};
balances = {};
supportedInterfaces = {
'0x36372b07': true, // ERC20
'0x06fdde03': true, // ERC20 name
'0x95d89b41': true, // ERC20 symbol
'0x313ce567': true, // ERC20 decimals
};
Transfer(sender, recipient, amount) {} // event
Approval(owner, spender, amount) {} // event
Mint(minter, amount) {} // event
Burn(burner, amount) {} // event
balanceOf(holderAddress) {
holderAddress = holderAddress.toLowerCase();
var tokenBalances = this.balances || {};
if (holderAddress in tokenBalances) {
const balance = tokenBalances[holderAddress];
return [balance];
}
return [number(0)];
}
transfer(recipient, amount) {
recipient = recipient.toLowerCase();
const sender = msg.sender;
var tokenBalances = this.balances || {};
if (! (sender in tokenBalances)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
if (tokenBalances[sender].lt(amount)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
if (this._decrementUserBalance.bind(this)(sender, amount)) {
this._incrementUserBalance.bind(this)(recipient, amount)
}
emit('Transfer', [sender, recipient, amount]);
return [true];
}
transferFrom(sender, recipient, amount) {
sender = sender.toLowerCase();
recipient = recipient.toLowerCase();
var tokenBalances = this.balances || {};
var tokenAllowances = this.allowed || {};
require(sender in tokenBalances, 'MISSING_TOKEN_BALANCE');
if (tokenBalances[sender].lt(amount)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
require(sender == msg.sender || (sender in tokenAllowances && msg.sender in tokenAllowances[sender]), "MISSING_ALLOWANCE");
if (sender != msg.sender && tokenAllowances[sender][msg.sender].lt(amount)) {
_throw('INSUFFICIENT_TOKEN_ALLOWANCE');
}
tokenAllowances[sender][msg.sender] = tokenAllowances[sender][msg.sender].sub(amount);
if (this._decrementUserBalance.bind(this)(sender, amount)) {
this._incrementUserBalance.bind(this)(recipient, amount)
}
emit('Transfer', [sender, recipient, amount]);
return [true];
}
allowance(owner, spender) {
owner = owner.toLowerCase();
spender = spender.toLowerCase();
var tokenAllowances = this.allowed || {};
if (owner in tokenAllowances && spender in tokenAllowances[owner]) {
return [tokenAllowances[owner][spender]];
}
return [number(0)];
}
approve(spender, value) {
spender = spender.toLowerCase();
var tokenAllowances = this.allowed || {};
if (! (msg.sender in tokenAllowances)) {
tokenAllowances[msg.sender] = {};
}
tokenAllowances[msg.sender][spender] = value;
emit('Approval', [msg.sender, spender, value]);
return [true];
}
mint(userAddress, amount) {
this._mint(userAddress, amount);
}
_mint(userAddress, amount) {
userAddress = userAddress.toLowerCase();
if (userAddress == address(0).address) {
_throw('ERC20: mint to the zero address');
}
if (this._incrementUserBalance.bind(this)(userAddress, amount)) {
this.totalSupply = this.totalSupply.add(amount);
}
emit('Mint', [userAddress, amount]);
}
burn(userAddress, amount) {
this._burn(userAddress, amount);
}
_burn(userAddress, amount) {
userAddress = userAddress.toLowerCase();
if (userAddress == address(0).address) {
_throw('ERC20: burn from the zero address');
}
if (this._decrementUserBalance.bind(this)(userAddress, amount)) {
this.totalSupply = this.totalSupply.sub(amount);
}
emit('Burn', [userAddress, amount]);
}
supportsInterface(interfaceID) {
const _interfaces = this.supportedInterfaces || {};
return [
((interfaceID in _interfaces)
? _interfaces[interfaceID]
: false)
];
}
_decrementUserBalance(holderAddress, amount) {
var tokenBalances = this.balances || {};
if (! (holderAddress in tokenBalances)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
if (amount.gt(tokenBalances[holderAddress])) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
tokenBalances[holderAddress] = tokenBalances[holderAddress].sub(amount);
return true;
}
_incrementUserBalance(holderAddress, amount) {
var tokenBalances = this.balances || {};
if (! (holderAddress in tokenBalances)) {
tokenBalances[holderAddress] = number(0);
}
tokenBalances[holderAddress] = tokenBalances[holderAddress].add(amount);
return true;
}
}
// Events
ERC20Token.prototype.Transfer.event = true;
ERC20Token.prototype.Transfer.inputs = ['address indexed', 'address indexed', 'uint256'];
ERC20Token.prototype.Approval.event = true;
ERC20Token.prototype.Approval.inputs = ['address indexed', 'address indexed', 'uint256'];
ERC20Token.prototype.Mint.event = true;
ERC20Token.prototype.Mint.inputs = ['address indexed', 'uint256'];
ERC20Token.prototype.Burn.event = true;
ERC20Token.prototype.Burn.inputs = ['address indexed', 'uint256'];
// Methods
ERC20Token.prototype.balanceOf.view = true;
ERC20Token.prototype.balanceOf.inputs = ['address'];
ERC20Token.prototype.balanceOf.outputs = ['uint256'];
ERC20Token.prototype.transfer.inputs = ['address', 'uint256'];
ERC20Token.prototype.transfer.outputs = ['bool'];
ERC20Token.prototype.transferFrom.inputs = ['address', 'address', 'uint256'];
ERC20Token.prototype.transferFrom.outputs = ['bool'];
ERC20Token.prototype.allowance.view = true;
ERC20Token.prototype.allowance.inputs = ['address', 'address'];
ERC20Token.prototype.allowance.outputs = ['uint256'];
ERC20Token.prototype.approve.inputs = ['address', 'uint256'];
ERC20Token.prototype.approve.outputs = ['bool'];
ERC20Token.prototype.mint.inputs = ['address', 'uint256'];
ERC20Token.prototype.mint.modifiers = ['_onlyOwner'];
ERC20Token.prototype._mint.internal = true;
ERC20Token.prototype.burn.inputs = ['address', 'uint256'];
ERC20Token.prototype.burn.modifiers = ['_onlyOwner'];
ERC20Token.prototype._burn.internal = true;
ERC20Token.prototype.supportsInterface.view = true;
ERC20Token.prototype.supportsInterface.inputs = ['bytes4'];
ERC20Token.prototype.supportsInterface.outputs = ['bool'];
ERC20Token.prototype._decrementUserBalance.internal = true;
ERC20Token.prototype._incrementUserBalance.internal = true;
function IERC20(tokenAddress) {
return address(tokenAddress).getContract();
}
class LiquidityPair extends ERC20Token {
name = 'LiquidityPair LPs';
symbol = 'LiquidityPair-LP';
decimals = 18;
totalSupply = number(0);
reserve0 = number(0);
reserve1 = number(0);
token0 = '0x0000000000000000000000000000000000000000';
token1 = '0x0000000000000000000000000000000000000000';
Initialize(token0, token1) {} // event
AddLiquidity(amount0, amount1) {} // event
RemoveLiquidity(amount0, amount1) {} // event
Transfer(from, to, value) {} // event
Mint(minter, amount0, amount1) {} // event
Burn(burner, amount0, amount1, to) {} // event
Sync(reserve0, reserve1) {} // event
Swap(sender, amount0In, amount1In, amount0Out, amount1Out, to) {} // event
constructor() {
super();
this.factory = msg.sender;
}
initialize(token0, token1) {
require(msg.sender == this.factory, 'Pancake: FORBIDDEN');
this.token0 = token0.toLowerCase();
this.token1 = token1.toLowerCase();
emit('Initialize', [token0, token1]);
}
getReserves() {
return [
this.reserve0,
this.reserve1,
];
}
_addLiquidity(amountADesired, amountBDesired) {
const [reserveA, reserveB] = this.getReserves();
let amountA, amountB;
if (reserveA.eq(0) && reserveB.eq(0)) {
[amountA, amountB] = [amountADesired, amountBDesired];
} else {
const amountBOptimal = this._quote(amountADesired, reserveA, reserveB)[0];
// TODO: a retester/revoir
if (true || ! amountBOptimal.gt(amountBDesired)) {
//require(!amountBOptimal.lt(amountBMin), 'PancakeRouter: INSUFFICIENT_B_AMOUNT');
[amountA, amountB] = [amountADesired, amountBOptimal];
} else {
const amountAOptimal = this._quote(amountBDesired, reserveB, reserveA)[0];
assert(!amountAOptimal.gt(amountADesired));
//require(!amountAOptimal.lt(amountAMin), 'PancakeRouter: INSUFFICIENT_A_AMOUNT');
[amountA, amountB] = [amountAOptimal, amountBDesired];
}
}
return [amountA, amountB];
}
_quote(amountA, reserveB, reserveA) {
require(amountA.gt(0), 'PancakeLibrary: INSUFFICIENT_AMOUNT');
require(reserveA.gt(0) && reserveB.gt(0), 'PancakeLibrary: INSUFFICIENT_LIQUIDITY');
const amountB = amountA.mul(reserveB).div(reserveA);
return [amountB];
}
addLiquidity(amountADesired, amountBDesired) {
require(this.token1 != '0x0000000000000000000000000000000000000000', "NOT_INITIALIZED");
const [amountA, amountB] = this._addLiquidity(amountADesired, amountBDesired);
const tokenA = this.token0;
const tokenB = this.token1;
IERC20(tokenA).transferFrom(msg.sender, address(this).address, amountA);
IERC20(tokenB).transferFrom(msg.sender, address(this).address, amountB);
const liquidity = this.mint(msg.sender)[0];
emit('AddLiquidity', [amountA, amountB]);
return [amountA, amountB, liquidity];
}
mint(to) {
require(this.token1 != '0x0000000000000000000000000000000000000000', "NOT_INITIALIZED");
const [_reserve0, _reserve1] = this.getReserves();
const balance0 = IERC20(this.token0).balanceOf(address(this).address)[0];
const balance1 = IERC20(this.token1).balanceOf(address(this).address)[0];
const amount0 = balance0.sub(_reserve0);
const amount1 = balance1.sub(_reserve1);
const MINIMUM_LIQUIDITY = 10**3;
function _min(a, b) {
return a.gt(b) ? b : a;
}
function sqrtBigInt(value) {
if (value < 0n) {
throw 'square root of negative numbers is not supported'
}
if (value < 2n) {
return value;
}
function _iter(n, x0) {
const x1 = ((n / x0) + x0) >> 1n;
if (x0 === x1 || x0 === (x1 - 1n)) {
return x0;
}
return _iter(n, x1);
}
return _iter(value, 1n);
}
function _sqrt(a) {
return number(sqrtBigInt(a.toBigInt()).toString());
}
let liquidity;
//const feeOn = _mintFee(_reserve0, _reserve1);
const _totalSupply = this.totalSupply;
if (_totalSupply == 0) {
liquidity = _sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
this._mint(address(0).address, MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = _min(amount0.mul(_totalSupply).div(_reserve0), amount1.mul(_totalSupply).div(_reserve1));
}
require(liquidity.gt(0), 'Pancake: INSUFFICIENT_LIQUIDITY_MINTED');
this._mint(to, liquidity);
this._update(balance0, balance1, _reserve0, _reserve1);
//if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
//emit('Mint', [msg.sender, amount0, amount1]);
return [
amount0,
];
}
removeLiquidity(liquidity) {
require(this.token1 != '0x0000000000000000000000000000000000000000', "NOT_INITIALIZED");
this.transferFrom(msg.sender, address(this).address, liquidity); // send liquidity to pair
const token0 = this.token0;
const [amountA, amountB] = this.burn(to);
//require(! amountA.lt(amountAMin), 'PancakeRouter: INSUFFICIENT_A_AMOUNT');
//require(! amountB.lt(amountBMin), 'PancakeRouter: INSUFFICIENT_B_AMOUNT');
require(amountA.gt(0), 'PancakeRouter: INSUFFICIENT_A_AMOUNT');
require(amountB.gt(0), 'PancakeRouter: INSUFFICIENT_B_AMOUNT');
emit('RemoveLiquidity', [amountA, amountB]);
return [amountA, amountB];
}
burn(to) {
require(this.token1 != '0x0000000000000000000000000000000000000000', "NOT_INITIALIZED");
const [_reserve0, _reserve1] = this.getReserves();
const _token0 = this.token0;
const _token1 = this.token1;
const balance0 = IERC20(_token0).balanceOf(address(this).address)[0];
const balance1 = IERC20(_token1).balanceOf(address(this).address)[0];
const liquidity = this.balanceOf[address(this).address];
//const feeOn = this._mintFee(_reserve0, _reserve1);
const _totalSupply = this.totalSupply;
const amount0 = liquidity.mul(balance0).div(_totalSupply); // using balances ensures pro-rata distribution
const amount1 = liquidity.mul(balance1).div(_totalSupply); // using balances ensures pro-rata distribution
require(amount0.gt(0) && amount1.gt(0), 'Pancake: INSUFFICIENT_LIQUIDITY_BURNED');
this._burn(address(this).address, liquidity);
IERC20(_token0).transfer(to, amount0);
IERC20(_token1).transfer(to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this).address);
balance1 = IERC20(_token1).balanceOf(address(this).address);
this._update(balance0, balance1, _reserve0, _reserve1);
//if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
//emit('Burn', [msg.sender, amount0, amount1, to]);
return [
amount0,
amount1,
]
}
_mint(to, value) {
this.totalSupply = this.totalSupply.add(value);
if (! (to in this.balances)) {
this.balances[to] = number(0);
}
this.balances[to] = this.balances[to].add(value);
emit('Transfer', [address(0).address, to, value]);
}
_burn(from, value) {
require(from in this.balances && ! this.balances[from].lt(this.balances[from]));
this.balances[from] = this.balances[from].sub(value);
this.totalSupply = this.totalSupply.sub(value);
emit('Transfer', [from, address(0).address, value]);
}
_update(balance0, balance1) {
this.reserve0 = balance0;
this.reserve1 = balance1;
emit('Sync', [this.reserve0, this.reserve1]);
}
swapExactTokensForTokens(sourceToken, amountIn, amountOutMin) {
require(this.token1 != '0x0000000000000000000000000000000000000000', "NOT_INITIALIZED");
sourceToken = sourceToken.toLowerCase();
const to = msg.sender;
const targetToken = (sourceToken == this.token0) ? this.token1 : this.token0;
const amounts = this._getAmountsOut(amountIn, sourceToken)[0];
require(! amounts[amounts.length - 1].lt(amountOutMin), 'PancakeRouter: INSUFFICIENT_OUTPUT_AMOUNT');
IERC20(sourceToken).transferFrom(msg.sender, address(this).address, amounts[0]);
this._swap(amounts, sourceToken, to);
return [amounts];
}
_getAmountsOut(amountIn, sourceToken) {
const [_reserve0, _reserve1] = this.getReserves();
const [reserveIn, reserveOut] = (sourceToken == this.token0) ? [_reserve0, _reserve1] : [_reserve1, _reserve0];
const amounts = [];
amounts.push(amountIn);
const _amount = this._getAmountOut(amounts[0], reserveIn, reserveOut)[0];
amounts.push(_amount);
return [amounts];
}
_getAmountOut(amountIn, reserveIn, reserveOut) {
require(amountIn.gt(0), 'PancakeLibrary: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn.gt(0) && reserveOut.gt(0), 'PancakeLibrary: INSUFFICIENT_LIQUIDITY');
const amountInWithFee = amountIn.mul(998);
const numerator = amountInWithFee.mul(reserveOut);
const denominator = reserveIn.mul(1000).add(amountInWithFee);
const amountOut = numerator.div(denominator);
return [amountOut];
}
swap(amount0Out, amount1Out, to, data) {
require(this.token1 != '0x0000000000000000000000000000000000000000', "NOT_INITIALIZED");
require(amount0Out.gt(0) || amount1Out.gt(0), 'Pancake: INSUFFICIENT_OUTPUT_AMOUNT');
const [_reserve0, _reserve1,] = this.getReserves();
require(amount0Out.lt(_reserve0) && amount1Out.lt(_reserve1), 'Pancake: INSUFFICIENT_LIQUIDITY');
let balance0;
let balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
const _token0 = this.token0;
const _token1 = this.token1;
require(to != _token0 && to != _token1, 'Pancake: INVALID_TO');
if (amount0Out.gt(0)) IERC20(_token0).transfer(to, amount0Out);
if (amount1Out.gt(0)) IERC20(_token1).transfer(to, amount1Out);
if (data && data.length > 0) IERC20(to).pancakeCall(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this).address)[0];
balance1 = IERC20(_token1).balanceOf(address(this).address)[0];
}
const amount0In = (balance0.gt(_reserve0.sub(amount0Out))) ? balance0.sub((_reserve0.sub(amount0Out))) : number(0);
const amount1In = (balance1.gt(_reserve1.sub(amount1Out))) ? balance1.sub((_reserve1.sub(amount1Out))) : number(0);
require(amount0In.gt(0) || amount1In.gt(0), 'Pancake: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
const balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(2));
const balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(2));
require(!balance0Adjusted.mul(balance1Adjusted).lt(_reserve0.mul(_reserve1).mul((1000**2).toString())), 'Pancake: K');
}
this._update(balance0, balance1, _reserve0, _reserve1);
emit('Swap', [msg.sender, amount0In, amount1In, amount0Out, amount1Out, to]);
}
_swap(amounts, sourceToken, _to) {
const targetToken = (sourceToken == this.token0) ? this.token1 : this.token0;
const path = [sourceToken, targetToken];
for (let i=0; i < path.length - 1; i++) {
const [input, output] = [ path[i], path[i + 1] ];
//const [token0,] = PancakeLibrary.sortTokens(input, output);
const token0 = (input > output) ? output : input;
const amountOut = amounts[i + 1];
const [amount0Out, amount1Out] = (input == token0) ? [number(0), amountOut] : [amountOut, number(0)];
const to = (i < path.length - 2) ? address(this).address : _to;
this.swap(amount0Out, amount1Out, to, '');
}
}
}
// Events
LiquidityPair.prototype.Initialize.event = true;
LiquidityPair.prototype.Initialize.inputs = ['address indexed', 'address indexed'];
LiquidityPair.prototype.AddLiquidity.event = true;
LiquidityPair.prototype.AddLiquidity.inputs = ['uint256', 'uint256'];
LiquidityPair.prototype.RemoveLiquidity.event = true;
LiquidityPair.prototype.RemoveLiquidity.inputs = ['uint256', 'uint256'];
LiquidityPair.prototype.Transfer.event = true;
LiquidityPair.prototype.Transfer.inputs = ['address indexed', 'uint256', 'uint256'];
LiquidityPair.prototype.Mint.event = true;
LiquidityPair.prototype.Mint.inputs = ['address indexed', 'uint256', 'uint256'];
LiquidityPair.prototype.Burn.event = true;
LiquidityPair.prototype.Burn.inputs = ['address indexed', 'uint256', 'uint256', 'address indexed'];
LiquidityPair.prototype.Sync.event = true;
LiquidityPair.prototype.Sync.inputs = ['uint256', 'uint256'];
LiquidityPair.prototype.Swap.event = true;
LiquidityPair.prototype.Swap.inputs = ['address indexed', 'uint256', 'uint256', 'uint256', 'uint256', 'address indexed'];
// Methods
LiquidityPair.prototype.initialize.inputs = ['address', 'address'];
LiquidityPair.prototype.getReserves.view = true;
LiquidityPair.prototype.getReserves.outputs = ['uint256', 'uint256'];
LiquidityPair.prototype._addLiquidity.internal = true;
LiquidityPair.prototype._quote.internal = true;
LiquidityPair.prototype._mint.internal = true;
LiquidityPair.prototype._burn.internal = true;
LiquidityPair.prototype.addLiquidity.inputs = ['uint256', 'uint256'];
LiquidityPair.prototype.addLiquidity.outputs = ['uint256', 'uint256', 'uint256'];
LiquidityPair.prototype.mint.inputs = ['address'];
LiquidityPair.prototype.mint.outputs = ['uint256'];
LiquidityPair.prototype.removeLiquidity.inputs = ['uint256'];
LiquidityPair.prototype.removeLiquidity.outputs = ['uint256', 'uint256'];
LiquidityPair.prototype.burn.inputs = ['address'];
LiquidityPair.prototype.burn.outputs = ['uint256', 'uint256'];
LiquidityPair.prototype.swapExactTokensForTokens.inputs = ['address', 'uint256', 'uint256'];
LiquidityPair.prototype.swapExactTokensForTokens.outputs = ['uint[]'];
LiquidityPair.prototype._getAmountsOut.internal = true;
LiquidityPair.prototype._getAmountOut.internal = true;
LiquidityPair.prototype.swap.inputs = ['uint256', 'uint256', 'address', 'bytes'];
LiquidityPair.prototype._swap.internal = true;
return LiquidityPair;
",
codeHash: "0x1231c860aaa3133dc899eeee065a2689bae9b4f7ee838ec7f51a876726b57e15",
codeAbi: {
0x8da5cb5b: {
constant: true,
"inputs": [],
name: "owner",
outputs: [
{
name: "",
type: "address"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x06fdde03: {
constant: true,
"inputs": [],
name: "name",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x95d89b41: {
constant: true,
"inputs": [],
name: "symbol",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x313ce567: {
constant: true,
"inputs": [],
name: "decimals",
outputs: [
{
name: "",
type: "uint256"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x18160ddd: {
constant: true,
"inputs": [],
name: "totalSupply",
outputs: [
{
name: "",
type: "uint256"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x19e1fca4: {
constant: true,
"inputs": [],
name: "allowed",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x7bb98a68: {
constant: true,
"inputs": [],
name: "balances",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x037cc0e6: {
constant: true,
"inputs": [],
name: "supportedInterfaces",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x443cb4bc: {
constant: true,
"inputs": [],
name: "reserve0",
outputs: [
{
name: "",
type: "uint256"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x5a76f25e: {
constant: true,
"inputs": [],
name: "reserve1",
outputs: [
{
name: "",
type: "uint256"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x0dfe1681: {
constant: true,
"inputs": [],
name: "token0",
outputs: [
{
name: "",
type: "address"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0xd21220a7: {
constant: true,
"inputs": [],
name: "token1",
outputs: [
{
name: "",
type: "address"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0xc45a0155: {
constant: true,
"inputs": [],
name: "factory",
outputs: [
{
name: "",
type: "address"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0xa8ac9b50: {
constant: true,
"inputs": [],
name: "prototype",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0xdc90fed0: {
inputs: [
{
name: "token0",
type: "address",
indexed: true
},
{
name: "token1",
type: "address",
indexed: true
}
],
name: "Initialize",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0xcb1652de: {
inputs: [
{
name: "amount0",
type: "uint256",
indexed: false
},
{
name: "amount1",
type: "uint256",
indexed: false
}
],
name: "AddLiquidity",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x9101fb4c: {
inputs: [
{
name: "amount0",
type: "uint256",
indexed: false
},
{
name: "amount1",
type: "uint256",
indexed: false
}
],
name: "RemoveLiquidity",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0xcf2aa508: {
inputs: [
{
name: "reserve0",
type: "uint256",
indexed: false
},
{
name: "reserve1",
type: "uint256",
indexed: false
}
],
name: "Sync",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0xd78ad95f: {
inputs: [
{
name: "sender",
type: "address",
indexed: true
},
{
name: "amount0In",
type: "uint256",
indexed: false
},
{
name: "amount1In",
type: "uint256",
indexed: false
},
{
name: "amount0Out",
type: "uint256",
indexed: false
},
{
name: "amount1Out",
type: "uint256",
indexed: false
},
{
name: "to",
type: "address",
indexed: true
}
],
name: "Swap",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x485cc955: {
inputs: [
{
name: "token0",
type: "address"
},
{
name: "token1",
type: "address"
}
],
name: "initialize",
"outputs": [],
stateMutability: "nonpayable",
type: "function"
},
0x0902f1ac: {
"inputs": [],
name: "getReserves",
outputs: [
{
name: "",
type: "uint256"
},
{
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
0x9cd441da: {
inputs: [
{
name: "amountADesired",
type: "uint256"
},
{
name: "amountBDesired",
type: "uint256"
}
],
name: "addLiquidity",
outputs: [
{
name: "",
type: "uint256"
},
{
name: "",
type: "uint256"
},
{
name: "",
type: "uint256"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x9c8f9f23: {
inputs: [
{
name: "liquidity",
type: "uint256"
}
],
name: "removeLiquidity",
outputs: [
{
name: "",
type: "uint256"
},
{
name: "",
type: "uint256"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x5152ac6f: {
inputs: [
{
name: "sourceToken",
type: "address"
},
{
name: "amountIn",
type: "uint256"
},
{
name: "amountOutMin",
type: "uint256"
}
],
name: "swapExactTokensForTokens",
outputs: [
{
name: "",
type: "uint[]"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x022c0d9f: {
inputs: [
{
name: "amount0Out",
type: "uint256"
},
{
name: "amount1Out",
type: "uint256"
},
{
name: "to",
type: "address"
},
{
name: "data",
type: "bytes"
}
],
name: "swap",
"outputs": [],
stateMutability: "nonpayable",
type: "function"
},
0x7fa9aafe: {
inputs: [
{
name: "from",
type: "address",
indexed: true
},
{
name: "to",
type: "uint256",
indexed: false
},
{
name: "value",
type: "uint256",
indexed: false
}
],
name: "Transfer",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x8c5be1e5: {
inputs: [
{
name: "owner",
type: "address",
indexed: true
},
{
name: "spender",
type: "address",
indexed: true
},
{
name: "amount",
type: "uint256",
indexed: false
}
],
name: "Approval",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x4c209b5f: {
inputs: [
{
name: "minter",
type: "address",
indexed: true
},
{
name: "amount0",
type: "uint256",
indexed: false
},
{
name: "amount1",
type: "uint256",
indexed: false
}
],
name: "Mint",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0xdccd412f: {
inputs: [
{
name: "burner",
type: "address",
indexed: true
},
{
name: "amount0",
type: "uint256",
indexed: false
},
{
name: "amount1",
type: "uint256",
indexed: false
},
{
name: "to",
type: "address",
indexed: true
}
],
name: "Burn",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x70a08231: {
inputs: [
{
name: "holderAddress",
type: "address"
}
],
name: "balanceOf",
outputs: [
{
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
0xa9059cbb: {
inputs: [
{
name: "recipient",
type: "address"
},
{
name: "amount",
type: "uint256"
}
],
name: "transfer",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x23b872dd: {
inputs: [
{
name: "sender",
type: "address"
},
{
name: "recipient",
type: "address"
},
{
name: "amount",
type: "uint256"
}
],
name: "transferFrom",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "nonpayable",
type: "function"
},
0xdd62ed3e: {
inputs: [
{
name: "owner",
type: "address"
},
{
name: "spender",
type: "address"
}
],
name: "allowance",
outputs: [
{
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
0x095ea7b3: {
inputs: [
{
name: "spender",
type: "address"
},
{
name: "value",
type: "uint256"
}
],
name: "approve",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x6a627842: {
inputs: [
{
name: "to",
type: "address"
}
],
name: "mint",
outputs: [
{
name: "",
type: "uint256"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x89afcb44: {
inputs: [
{
name: "to",
type: "address"
}
],
name: "burn",
outputs: [
{
name: "",
type: "uint256"
},
{
name: "",
type: "uint256"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x01ffc9a7: {
inputs: [
{
name: "interfaceID",
type: "bytes4"
}
],
name: "supportsInterface",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
0x8be0079c: {
inputs: [
{
name: "oldOwner",
type: "address",
indexed: true
},
{
name: "newOwner",
type: "address",
indexed: true
}
],
name: "OwnershipTransferred",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x893d20e8: {
"inputs": [],
name: "getOwner",
outputs: [
{
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
0xf2fde38b: {
inputs: [
{
name: "newOwner",
type: "address"
}
],
name: "transferOwnership",
"outputs": [],
stateMutability: "nonpayable",
type: "function"
}
},
contractName: "LiquidityPair",
storage: {
prototype: {
address: "0xe58b9e60afe16e5707376e84372fa1dfbebf71f0"
},
owner: "0x131a190fa22cb867abf58193bf9e7640e9fce682",
name: "LiquidityPair LPs",
symbol: "LiquidityPair-LP",
decimals: 18,
totalSupply: {
type: "BigNumber",
hex: "0x00"
string: "0"
ether: "0.0"
},
"allowed": {},
"balances": {},
supportedInterfaces: {
0x36372b07: true,
0x06fdde03: true,
0x95d89b41: true,
0x313ce567: true
},
reserve0: {
type: "BigNumber",
hex: "0x00"
string: "0"
ether: "0.0"
},
reserve1: {
type: "BigNumber",
hex: "0x00"
string: "0"
ether: "0.0"
},
token0: "0x2347d36cf0d94b98bab6d6d41c6f94d7214830ad",
token1: "0x92c8b8729d850d99c34c50ab2846ec36169e0024",
factory: "0x131a190fa22cb867abf58193bf9e7640e9fce682"
},
storageHash: "0xe2f98512fc593b4092a8def6c5177dddf010328dbb0161c09d50ef3b7a612ea1",
savedOnBlockNumber: {
type: "BigNumber",
hex: "0x10"
string: "16"
ether: "0.000000000000000016"
}
}