ABI Reference
Last updated
Last updated
The Warpswap Protocol consists of two smart contracts, namely the Warpswap Router and the Warpswap Minter. The Router contract is responsible for all aspects of the protocol except for the rewards, which are managed by the Minter. Before the full release of the Solidity code as per the , only the Router's ABI will be provided in this section as it is sufficient to fully enable interaction with the Protocol.
Note that the Minter contract does implement the standard ERC-721 interface so that this contract supports all the methods required by this token standard. Moreover, the current version of the Warpswap Router only supports pairs where one of the tokens is the blockchain's native currency(such as ETH). Unless indicated otherwise, all price calculations are fully consistent with those of .
The Warpswap Router is deployed at 0x6c9dcb67c805bbfb1699e4053eec2a9083b28ef3 on Ethereum Mainnet and will soon be deployed on Base Mainnet. The Warpswap Minter is deployed at 0xf4Dd897CaC5B5B5dcc0eAEa16203eFe578439120 on Ethereum Mainnet and at will soon be deployed on Base Mainnet.
Given some asset amount and reserves, returns an amount of the other asset representing equivalent value. Fully analogous to its Uniswap v2 equivalent.
Returns the ETH and token reserves for a given ETH-token pair.
Calculates the liquidity provider's share of the total position value in a pair after adding an amount of addedToken and addedETH to the pair, respectively. newPair is a boolean used to indicate whether liquidity was ever added for this pair before. Fully analogous to the Uniswap v2 calculation of LP token awards to liquidity providers.
Calculates the amount of one asset given out after sending amountIn of the other asset, given pair reserves and a liquidity provision fee amount. This fee amount defaults to 990 for most pairs and equals 997 for stable pairs, representing the 1% and 0.3% fee tiers for normal and stable pairs respectively as it is quoted in tenths of basis points.
Calculates the amount needed of one asset to receive amountOut of the other asset, given pair reserves and a liquidity provision fee amount.
Unless stated otherwise, all calculations and features of the methods below are identical to those of Uniswap v2.
Adds liquidity to an ETH-token pair, creating the pair if it did not yet exist.
An allowance of at least amountTokenDesired needs to be given to the router by the caller.
Sends leftover ETH back to the caller and uses less tokens than amountTokenDesired, if possible.
The final amounts of ETH and tokens are bounded from above by amountTokenDesired and msg.value, respectively, and by amountTokenMin and amountETHMin from below. If slippage does not need to be taken into account, the last two variables can be set to zero.
If the transaction is not confirmed before the deadline given as a Unix timestamp, it will be cancelled.
The Warpswap NFT representing the new liquidity position is minted to the address specified by "to".
Removes 100% of the liquidity represented by the NFT with ID equal to nftId and claims the available liquidity provider rewards at once, sending the resulting token and ETH amounts to the address specified by "to".
Identical to the function above but takes token fees into account when accounting for slippage using amountTokenMin and amountETHMin.
Swaps an exact amount of ETH specified by msg.value for as many tokens as possible, returning the actual amount received.
Identical to the function above but takes token fees into account when acounting for slippage using amountOutMin.
Takes the least amount of ETH needed to obtain amountOut tokens and returns the amount of ETH actually used.
This method reverts if too few ETH is sent with the transaction; use it in tandem with getAmountIn to make sure the amount sent is sufficient.
Swaps an exact amount of tokens specified by amountIn for as much ETH as possible, returning the actual amount of ETH received.
Identical to the function above but takes token fees into account when acounting for slippage using amountOutMin.
Takes the least amount of tokens needed to obtain amountOut ETH and returns the amount of tokens actually used.
This method reverts if too few tokens are sent with the transaction; use it in tandem with getAmountIn to make sure the amount sent is sufficient.
NOTE: this method will always revert if the token features a transfer tax. The two methods above are the only available ones to swap tokens for ETH in this case.