Helpful?
Factory
Code
Donaswap v2 Factory Addresses
Network | ChainId | Contract Address | Explorer |
---|---|---|---|
Firechain | 529 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Rinia | 917 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Arbtitrum | 42161 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Arbtitrum Goerli | 421613 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Astar | 592 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Aurora | 1313161554 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Aurora Testnet | 1313161555 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Avalanche | 43114 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Avalanche Fuji | 43113 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Base | 8453 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Base Goerli | 84531 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
BitTorrent Chain Testnet | 1028 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
BNB Smart Chain | 56 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
BNB Smart Chain Testnet | 97 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
CadduceusChain | 256256 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
CadduceusChain Testnet | 512512 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Celo | 42220 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Celo Alfajores | 44787 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
CoinEx | 53 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Conflux eSpace | 1030 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Conflux eSpace Testnet | 71 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Core | 1116 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Core Sepolia | 1115 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Cronos Testnet | 338 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Dogechain | 2000 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Dogechain Testnet | 568 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Ethereum | 1 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Fantom Opera | 250 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Fantom Testnet | 4002 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Flare | 14 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Flare Testnet | 114 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Fuse | 122 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Fuse Sparknet | 123 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Fusion | 32659 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Fusion Testnet | 46688 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Gnosis Chiado | 10200 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Goerli | 5 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Harmony | 1666600000 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Harmony Testnet | 1666700000 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Heco | 128 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Holesky | 17000 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Kardiachain | 24 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Kava | 2222 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Kava Testnet | 2221 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Kcc | 321 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Klaytn | 8217 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Klaytn Baobab | 1001 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Linea | 59144 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Linea Goerli | 59140 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Metis | 1088 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Metis Goerli | 599 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Moonbase | 1287 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Moonbeam | 1284 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Moonriver | 1285 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
OkxChain | 65 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Optimism | 10 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Optimism Goerli | 420 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Palm | 11297108109 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Palm Testnet | 11297108099 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Polygon | 137 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Polygon Mumbai | 80001 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Polygon ZkEvm | 1101 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Polygon ZkEvm Testnet | 1442 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Pulsechain | 369 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Pulsechain Testnet | 943 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Rootstock Testnet | 31 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Scroll Sepolia | 534351 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Sepolia | 11155111 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Shibarium | 109 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Sibarium Testnet | 719 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Shibunya | 81 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Telos | 40 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Telos Testnet | 41 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
ThunderCore | 108 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
ThunderCore Testnet | 18 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
TomoChain Testnet | 89 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Ultron Testnet | 1230 | 0x8e5dff1c121F661971d02950698f8c5EFc3DfA78 | Code |
Events
PairCreated
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
Emitted each time a pair is created via createPair.
token0
is guaranteed to be strictly less thantoken1
by sort order.- The final
uint
log value will be1
for the first pair created,2
for the second, etc. (see allPairs/getPair).
Read-Only Functions
getPair
function getPair(address tokenA, address tokenB) external view returns (address pair);
Returns the address of the pair for tokenA
and tokenB
, if it has been created, else address(0)
(0x0000000000000000000000000000000000000000
).
tokenA
andtokenB
are interchangeable.- Pair addresses can also be calculated deterministically via the SDK.
allPairs
function allPairs(uint) external view returns (address pair);
Returns the address of the n
th pair (0
-indexed) created through the factory, or address(0)
(0x0000000000000000000000000000000000000000
) if not enough pairs have been created yet.
- Pass
0
for the address of the first pair created,1
for the second, etc.
allPairsLength
function allPairsLength() external view returns (uint);
Returns the total number of pairs created through the factory so far.
feeTo
function feeTo() external view returns (address);
See Exchange Charge Calculation.
feeToSetter
function feeToSetter() external view returns (address);
The address allowed to change feeTo.
State-Changing Functions
createPair
function createPair(address tokenA, address tokenB) external returns (address pair);
Creates a pair for tokenA
and tokenB
if one doesn't exist already.
tokenA
andtokenB
are interchangeable.- Emits PairCreated.
Interface
import '@donaswap/core/contracts/interfaces/IDonaswapFactory.sol';
pragma solidity =0.5.16;
interface IDonaswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function migrator() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
function setMigrator(address) external;
}
ABI
import IDonaswapFactory from '@donaswap/core/build/IDonaswapFactory.json'
https://unpkg.com/@donaswap/core@1.0.1-alpha/build/IDonaswapFactory.json