跳到主要內容

CurrencyManager

It allows adding/removing currencies for trading on the LooksRare exchange.

Methods​

addCurrency​

function addCurrency(address currency) external nonpayable

Add a currency in the system

Parameters​

NameTypeDescription
currencyaddressaddress of the currency to add

isCurrencyWhitelisted​

function isCurrencyWhitelisted(address currency) external view returns (bool)

Returns if a currency is in the system

Parameters​

NameTypeDescription
currencyaddressaddress of the currency

Returns​

NameTypeDescription
-boolwhether currency is tradable

owner​

function owner() external view returns (address)

Returns the address of the current owner.

Returns​

NameTypeDescription
owneraddressaddress of the current owner

removeCurrency​

function removeCurrency(address currency) external nonpayable

Remove a currency from the system

Parameters​

NameTypeDescription
currencyaddressaddress of the currency to remove

renounceOwnership​

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership​

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters​

NameTypeDescription
newOwneraddressaddress of the new owner

viewCountWhitelistedCurrencies​

function viewCountWhitelistedCurrencies() external view returns (uint256)

View number of whitelisted currencies

Returns​

NameTypeDescription
-uint256number of currencies valid on the exchange

viewWhitelistedCurrencies​

function viewWhitelistedCurrencies(uint256 cursor, uint256 size) external view returns (address[], uint256)

See whitelisted currencies in the system

Parameters​

NameTypeDescription
cursoruint256cursor (should start at 0 for first request)
sizeuint256size of the response (e.g., 50)

Returns​

NameTypeDescription
-address[]array of currency addresses
cursoruint256cursor position

Events​

CurrencyRemoved​

event CurrencyRemoved(address indexed currency)

Parameters​

NameTypeDescription
currency indexedaddressaddress of the currency

CurrencyWhitelisted​

event CurrencyWhitelisted(address indexed currency)

Parameters​

NameTypeDescription
currency indexedaddressaddress of the currency

OwnershipTransferred​

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters​

NameTypeDescription
previousOwner indexedaddressaddress of the previous owner
newOwner indexedaddressaddress of the new owner