Noah
Launch AppTwitterTelegram
繁體
繁體
  • Noah簡介
    • NOAH 代幣經濟模型
    • NOAH挖礦教程
      • NOAH 簡易版挖礦教程
  • 常見問題
    • ⛏️NOAH 治理-常見問答
    • ✍️如何切換PRC節點
    • 🔍如何在MetaMask錢包配置EOS EVM/exSat Network網路?
    • 📜EOS EVM鏈EOS代幣充值提現教程(針對OKX交易平臺)
    • 🌉如何將代幣(EOS)在EOS EVM網絡和EOS網絡間互相轉移?
    • 🎒如何直接使用幣安將EOS代幣提現到EOS EVM上
    • 🎃常見報錯以及解決方式
    • ♋關於Multichain跨鏈資產包含的代幣logo更替說明
  • 合約安全
  • 聯系我們
  • NOAH代幣信息
    • Noah空投規則(2023-05-15)
    • Noah空投規則(2023-06-26)
    • Noah空投規則(2023-10-17)
    • Noah×Defibox 聯合活動空投
    • 團隊&顧問激勵及VC投資質押情況
  • 產品功能
    • 📕Swap 兑换
    • 📘Liquidity 流動性
    • 📬如何上傳項目代幣圖示
  • 智能合約
    • Noah Swap
      • Noah Factory
      • Noah Router
  • 市場活動
    • NOAH上線Bigone交易所活動
Powered by GitBook
On this page
  • Contract info
  • Read functions
  • getPair
  • allPairs
  • allPairsLength
  • feeTo
  • getFeeRate #
  • Write functions
  • createPair
  • setFeeTo
  • setFeeRate
  • toggleState
  • Events
  • PairCreated
  • SetFeeRate
  • Interface
  1. 智能合約
  2. Noah Swap

Noah Factory

PreviousNoah SwapNextNoah Router

Last updated 2 years ago

Contract info

Contract name: Noah Factory

View

EOS EVM Network Contract address: 0x75782A57c6522B8B17FCc01Ff11759f4535b2752 View the

Read functions

getPair

function getPair(address tokenA, address tokenB) external view returns (address pair);

Address for tokenA and address for tokenB return address of pair contract (where one exists).

tokenA and tokenB order is interchangeable.

Returns 0x0000000000000000000000000000000000000000 as address where no pair exists.

allPairs

function allPairs(uint) external view returns (address pair);

Returns the address of the nth pair (0-indexed) created through the Factory contract.

Returns 0x0000000000000000000000000000000000000000 where pair has not yet been created.

Begins at 0 for first created pair.

allPairsLength

function allPairsLength() external view returns (uint);

Displays the current number of pairs created through the Factory contract as an integer.

feeTo

function feeTo() external view returns (address);

The address to where non-LP-holder fees are sent.

getFeeRate #

function getFeeRate(address pair) external view returns (uint);

The right to set the handling fee for each pair, the default is 0.3%.

Write functions

createPair

function createPair(address tokenA, address tokenB) external returns (address pair);

Creates a pair for tokenA and tokenB where a pair doesn't already exist.

tokenA and tokenB order is interchangeable.

Emits PairCreated (see Events).

setFeeTo

function setFeeTo(address account) external returns ();

Sets address for feeTo.

setFeeRate

function setFeeRate(address pair,uint) external returns ();

Set the handling fee for each pair.

toggleState

function toggleState() external returns ();

Set the contract switch and update the status once.

Events

PairCreated

event PairCreated(address indexed token0, address indexed token1, address pair, uint);

Emitted whenever a createPair creates a new pair.

token0 will appear before token1 in sort order.

The final uint log value will be 1 for the first pair created, 2 for the second.

SetFeeRate

event SetFeeRate(address indexed pair, uint);

The log that is synchronized after each transaction fee is set.

Interface

import './interfaces/INoahFactory.sol';

// pragma solidity >=0.5.0;
interface INoahFactory { 
    event PairCreated(address indexed token0, address indexed token1, address pair, uint256 pid); 
    
    event SetFeeRate(address indexed pair, uint256 feeRate);
    
    // Returns uint
    // Pending  - 0
    // Active  - 1
    enum State {Pending, Active}
    
    function state() external view returns (State);
    
    function feeTo() external view returns (address);
    
    function admin() external view returns (address);
    
    function getPair(address tokenA, address tokenB) external view returns (address pair);
    
    function getFeeRate(address pair) external view returns (uint256 feeRate);
    
    function allPairs(uint256) external view returns (address pair);
    
    function allPairsLength() external view returns (uint256);
    
    function createPair(address tokenA, address tokenB) external returns (address pair);
    
    function setFeeTo(address) external;
    
    function setAdmin(address) external;
    
    function setFeeRate(address pair, uint256 _feeRate) external;
    
    function toggleState() external;
    
    function INIT_CODE_PAIR_HASH() external view returns (bytes32);
}
NoahFactory.sol on Github.
Noah Swap:Factory contract on evm