Quoter

Contract info

Contract name: Quoter Protocol

Contract addresses:

Harmony Mainnet: 0xFFFD451F62bE856E0cADdAc7c9a2e60aC5842C48

Binance Smart Chain Mainnet: 0x76540F7e38dFCdF3b39A501Bb7ef77c3705f4F17

Harmony Testnet: 0x028739801886AC60E0428e918e2bC9cA5D06399E

Functions

balance

function balance(address token) external view returns (uint256)

Returns balance of a token available for use in Quoter.

Parameters:

NameTypeDescription

token

address

Token address of a token to check balance of.

Returns:

TypeDescription

uint256

Balance of given token

cancelOrderRFQ

function cancelOrderRFQ(uint256 orderInfo) external override

Cancels order's quote.

Paramaters:

NameTypeDescription

orderInfo

uint256

Order info contains timestamp and order id

createOrUpdateSession

function createOrUpdateSession(address sessionKey, uint256 expirationTime)
        external
        returns (SessionStatus)

Creates or updates session that lets maker and taker to trade without signing messages through wallet.

Parameters:

NameTypeDescription

sessionKey

address

Public key of a session

expirationTime

uint256

Expiration time in unix seconds timestamp

Returns:

TypeDescription

SessionStatus

One of the value from enum (created, updated) that indicates the status of session

depositToken

function depositToken(address token, uint256 amount)
        external
        returns (uint256)

Deposits given token of frontend to the Quoter smart contract and stores the balance information.

NameTypeDescription

token

address

Address of token to deposit, depositing wallet must give an allowance to the Quoter smart contract for given amount

amount

uint256

Amount of tokens to deposit

Returns:

TypeDescription

uint256

The balance after depositing the tokens

endSession

function endSession() external;

Terminates active session

fillOrderRFQ

function fillOrderRFQ(
        OrderRFQ memory order,
        bytes calldata signature,
        uint256 takingAmount,
        uint256 makingAmount
    ) external returns (OrderRFQAmounts memory amounts);

Fills order's quote, fully or partially (whichever is possible)

Parameters:

NameTypeDescription

order

OrderRFQ

Order quote to fill

signature

bytes

Signature to confirm quote ownership

takingAmount

uint256

Taking amount

makingAmount

uint256

Making amount

Returns:

TypeDescription

amounts

OrderRFQAmounts

Amounts - filled taking and making amounts

fillOrderRFQCallPeriphery

function fillOrderRFQCallPeriphery(
        OrderRFQ memory order,
        bytes calldata signature,
        uint256 takingAmount,
        uint256 makingAmount,
        address receiver,
        bytes calldata data
    ) external returns (OrderRFQAmounts memory amounts, bytes memory result);

Fills order's quote, fully or partially (whichever is possible) and calls external contract function

Parameters:

NameTypeDescription

order

OrderRFQ

Order quote to fill

signature

bytes

Signature to confirm quote ownership

takingAmount

uint256

Taking amount

makingAmount

uint256

Making amount

receiver

address

Address of contract that will receive the call after successful validation of RFQ order and transfer from taker to maker

data

bytes

external call data

Returns:

TypeDescription

amounts

OrderRFQAmounts

Amounts - filled taking and making amounts

session

function session(address owner)
        external
        view
        returns (
            address creator,
            address sessionKey,
            uint256 expirationTime,
            uint256 txCount
        );

Returns session data

Parameters:

NameTypeDescription

owner

address

Wallet address of the session's owner

Returns:

NameTypeDescription

creator

adress

Wallet address of the session's owner

sessionKey

address

Session public key

expirationTime

uint256

Session expiration unix timestamp, might be zero if it was terminated

txCount

uint256

Number of transactions made during session

sessionExpirationTime

function sessionExpirationTime(address owner)
        external
        view
        returns (uint256 expirationTime);

Returns expiration unix timestamp of given address session

Parameters:

NameTypeDescription

owner

address

Wallet address of the session's owner

Returns:

NameTypeDescription

expirationTime

uint256

Session expiration unix timestamp, might be zero if it was terminated

setReferralBonus

function setReferralBonus(uint256 bonus) external onlyOwner;

//Opis

Parameters:

NameTypeDescription

bonus

uint256

transferOwnership

 function transferOwnership(address to)
        external
        onlyOwner
        returns (address oldOwner, address newOwner)

//Opis

Parameters:

NameTypeDescription

to

address

Address of wallet that will receive ownership

Returns:

NameTypeDescription

oldOwner

address

Address of previous owner

newOwner

address

Address of new owner

withdrawToken

function withdrawToken(address token, uint256 amount) 
        external returns (uint256);

Withdraws given token of frontend from the Quoter contract

Parameters:

NameTypeDescription

token

address

Address of a token to withdraw

amount

uint256

Amount of tokens to withdraw

Returns:

TypeDescription

uint256

Balance after withdrawing the tokens

Events

OrderFilledRFQ

event OrderFilledRFQ(bytes32 orderHash, uint256 takingAmount, uint256 makingAmount);

Event emmited when RFQ order was filled.

Parameters:

NameTypeDescription

orderHash

bytes32

Hash of the order

takingAmount

uint256

Taking amount

makingAmount

uint256

Making amount

OwnershipTransfered

//opis

Parameters:

NameTypeDescription

from

address

to

address

SessionCreated

event SessionCreated(
        address indexed creator,
        address indexed sessionKey,
        uint256 expirationTime
    );

Event emmited on successful session creation

Parameters:

NameTypeDescription

creator

address

Address of wallet creating the session

sessionKey

address

Public key of the session

expirationTime

uint256

Session expiration time in unix timestamp

SessionTerminated

 event SessionTerminated(address indexed sender, address indexed sessionKey);

Event emmited on successful session termination

Parameters:

NameTypeDescription

sender

address

Address of wallet terminating the session

sessionKey

address

Public key of the session

SessionUpdated

event SessionUpdated(
        address indexed sender,
        address indexed sessionKey,
        uint256 expirationTime
    );

Event emitted on successful session update

Parameters:

NameTypeDescription

sender

address

Address of wallet updating

the session

sessionKey

address

Public key of the session

expirationTime

uint256

Session expiration time in unix timestamp

SplitTokenTransfered

event SplitTokenTransfered(
        address indexed from,
        address indexed recipient,
        address indexed splitTo,
        address token, // Due to limitations only three event's arguments can be indexed
        uint256 splitPercentage,
        uint256 amount,
        uint256 balance
    );

Event emitted on successful transfer of fee token - split between contract owner and frontend

Parameters:

NameTypeDescription

from

address

Address of wallet that transfers token

recipient

address

Address of first recipient

splitTo

address

Address of second recipient

token

address

Address of deposited token

splitPercentage

uint256

Percentage used to split amount between recipient and splitTo

amount

uint256

Desposit amount

balance

uint256

Balance after fee token transfer

TokenDeposited

event TokenDeposited(
        address indexed sender,
        address indexed token,
        uint256 amount,
        uint256 balance
    );

Event emitted on successful deposit of token

NameTypeDescription

sender

address

Address of wallet depositing the token

token

address

Address of the deposited token

amount

uint256

Deposit amount

balance

uint256

Balance after deposit

TokenTransferred

event TokenTransfered(
        address indexed from,
        address indexed recipient,
        address indexed token,
        uint256 amount,
        uint256 balance
    );

Event emitted on successful transfer of token

Parameters:

NameTypeDescription

from

address

Address of wallet transfering the token

recipient

address

Address of the token recipient

token

address

Address of the transfered token

amount

uint256

Transfer amount

balance

uint256

Balance after transfer

TokenWithdrawn

event TokenWithdrawn(
        address indexed sender,
        address indexed token,
        uint256 amount,
        uint256 balance
    );

Event emitted on successful withdrawn of token

Parameters:

NameTypeDescription

sender

address

Address of wallet withdrawing the token

token

address

Address of the withdrawn token

amount

uint256

Withdraw amount

balance

uint256

Balance after withdraw

Models

Session

struct Session {
        address creator;
        address sessionKey;
        uint256 expirationTime;
        uint256 txCount;
    }

Properties:

NameTypeDescription

creator

adress

Wallet address of the session's owner

sessionKey

address

Session public key

expirationTime

uint256

Session expiration unix timestamp, might be zero if it was terminated

txCount

uint256

Number of transactions made during session

OrderRFQ

struct OrderRFQ {
        uint256 info;
        uint256 feeAmount;
        address takerAsset;
        address makerAsset;
        address feeTokenAddress;
        address frontendAddress;
        bytes takerAssetData;
        bytes makerAssetData;
    }

Properties:

NameTypeDescription

info

uint256

feeAmount

uint256

takerAsset

address

makerAsset

address

feeTokenAddress

address

frontendAddress

address

takerAssetData

bytes

makerAssetData

bytes

OrderRQFAmounts

struct OrderRFQCallbackInfo {
        address takerAsset;
        address makerAsset;
        uint256 takingAmount;
        uint256 makingAmount;
    }

Properties:

NameTypeDescription

takerAsset

address

makerAsset

address

takingAmount

uint256

makingAmount

uint256

Last updated