Contracts

All contracts are on the NEAR Protocol. The source code of Ref Finance can be found on Github.

Find below the list of all accounts that have directly managed or currently manage the affairs of Ref Finance.

Mainnet Contracts

Testnet Contracts

Timelock

Timelocks are a smart contract feature that states that some actions will only be performed after a certain period of time rather than immediately.

Ref Finance does not use/have a timelock feature. Ref contracts are directly upgraded from the DAO (ref-finance.sputnik-dao.near), thus providing time to users, via the voting period of the associated proposal, to protect their funds in case they identify suspicious activities.

DAO proposals usually take from 48 to 72 hours either to get approved or rejected.

Frozen List

The Ref Finance Exchange contract (v2.ref-finance.near) has a 'Frozen List' feature, which was deployed on version 1.6.0+.

The feature enables the owner and/or Guardians of the contract to freeze any token listed on the exchange. When frozen, any action (Swap, Add/Remove liquidity, Deposit, Withdraw, etc.) on the corresponding token will fail, resulting in a 'panic error' at the contract level.

The owner and/or Guardians can use the following commands to freeze/unfreeze any token:

near call $REF_EX extend_frozenlist_tokens '{"tokens": ["'$TOKEN1'", "'$TOKEN2'"]}' --account_id=$REF_GUARDIAN --depositYocto=1

near call $REF_EX remove_frozenlist_tokens '{"tokens": ["'$TOKEN1'", "'$TOKEN2'"]}' --account_id=$REF_GUARDIAN --depositYocto=1

To get the Frozen List, anyone can query the following command:

near view $REF_EX get_frozenlist_tokens

Motivation

The Frozen List feature has been designed to mitigate the impact of any attack or hack associated to a specific token and its potential contagion within the ecosystem.

The feature can also be activated as a preventive measure. For example, in November 2022, Metapool identified a critical bug on its contract. Ref Finance was informed and immediately froze the STNEAR token, preventing users from any associated action (trading and pooling) on Ref, thus reducing the severity of the impact (trading losses, extreme volatility, etc.) that such a bug could have caused to traders and LPs.

Last updated