SkillAgentSearch skills...

Contracts V3

Bancor is a decentralized trading and yield protocol. Its network of on-chain automated market makers (AMMs) supports instant token-to-token trades, as well as single-sided liquidity provision, auto-compounding rewards and 100% impermanent loss protection for any listed asset.

Install / Use

npx skills add bancorprotocol/contracts-v3

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Zed

README

Bancor 3 Dawn

Bancor Protocol Contracts v3.0 (Dawn Release)

Build Status

Overview

Bancor is a decentralized trading and yield protocol. Its network of on-chain automated market makers (AMMs) supports instant token-to-token trades, as well as single-sided liquidity provision and auto-compounding staking rewards for any listed asset.

The Dawn release includes the following features:

  • Token to token trades
  • Single-sided Liquidity Provision
  • Omnipool
  • Infinity Pools
  • Auto-compounding Rewards
  • Dual Rewards
  • Third Party Liquidity Protection
  • Composable Pool Tokens
  • Tokenomics Redesign
  • Flash Loans

Security Audits

Setup

As a first step of contributing to the repo, you should install all the required dependencies via:

yarn install

You will also need to create and update the .env file if you’d like to interact or run the unit tests against mainnet forks (see .env.example)

Testing

Testing the protocol is possible via multiple approaches:

Unit Tests

You can run the full test suite (takes about two hours) via:

yarn test

You can also run the test suite with additional stress tests via:

yarn test:nightly

This suite is called “nightly” since it’s scheduled to run every day at midnight against the release and production branches (see nightly.yml).

Deployment Tests

You can test new deployments (and the health of the network) against a mainnet fork via:

yarn test:deploy

This will automatically be skipped on an already deployed and configured deployment scripts and will only test the additional changeset resulting by running any new/pending deployment scripts and perform an e2e test against the up to date state. This is especially useful to verify that any future deployments and upgrades, suggested by the DAO, work correctly and preserve the integrity of the system.

Test Coverage

You can find historic test coverage reports in releases.

Latest Test Coverage Report (2022-04-24)

  • 99.86% Statements 1476/1478
  • 97.36% Branches 479/492
  • 100% Functions 446/446
  • 99.31% Lines 1580/1591

Coverage Report

-------------------------------------------|----------|----------|----------|----------|
File                                       |  % Stmts | % Branch |  % Funcs |  % Lines |
-------------------------------------------|----------|----------|----------|----------|
 bancor-portal/                            |      100 |      100 |      100 |      100 |
  BancorPortal.sol                         |      100 |      100 |      100 |      100 |
 bancor-portal/interfaces/                 |      100 |      100 |      100 |      100 |
  IBancorPortal.sol                        |      100 |      100 |      100 |      100 |
 network/                                  |      100 |    96.77 |      100 |    99.16 |
  BancorNetwork.sol                        |      100 |    96.97 |      100 |    99.16 |
  BancorNetworkInfo.sol                    |      100 |      100 |      100 |      100 |
  BancorV1Migration.sol                    |      100 |      100 |      100 |      100 |
  NetworkSettings.sol                      |      100 |      100 |      100 |      100 |
  PendingWithdrawals.sol                   |      100 |    88.89 |      100 |    96.67 |
 network/interfaces/                       |      100 |      100 |      100 |      100 |
  IBancorNetwork.sol                       |      100 |      100 |      100 |      100 |
  IBancorNetworkInfo.sol                   |      100 |      100 |      100 |      100 |
  INetworkSettings.sol                     |      100 |      100 |      100 |      100 |
  IPendingWithdrawals.sol                  |      100 |      100 |      100 |      100 |
 pools/                                    |     99.8 |    95.73 |      100 |    99.03 |
  BNTPool.sol                              |      100 |    94.44 |      100 |    98.98 |
  PoolCollection.sol                       |    99.67 |    95.97 |      100 |    99.05 |
  PoolCollectionWithdrawal.sol             |      100 |    92.86 |      100 |    98.15 |
  PoolMigrator.sol                         |      100 |      100 |      100 |      100 |
  PoolToken.sol                            |      100 |      100 |      100 |      100 |
  PoolTokenFactory.sol                     |      100 |      100 |      100 |      100 |
 pools/interfaces/                         |      100 |      100 |      100 |      100 |
  IBNTPool.sol                             |      100 |      100 |      100 |      100 |
  IPoolCollection.sol                      |      100 |      100 |      100 |      100 |
  IPoolMigrator.sol                        |      100 |      100 |      100 |      100 |
  IPoolToken.sol                           |      100 |      100 |      100 |      100 |
  IPoolTokenFactory.sol                    |      100 |      100 |      100 |      100 |
 rewards/                                  |    99.66 |    98.18 |      100 |    99.37 |
  AutoCompoundingRewards.sol               |     98.8 |    94.44 |      100 |     97.8 |
  RewardsMath.sol                          |      100 |      100 |      100 |      100 |
  StandardRewards.sol                      |      100 |      100 |      100 |      100 |
 rewards/interfaces/                       |      100 |      100 |      100 |      100 |
  IAutoCompoundingRewards.sol              |      100 |      100 |      100 |      100 |
  IStandardRewards.sol                     |      100 |      100 |      100 |      100 |
 token/                                    |      100 |      100 |      100 |      100 |
  ERC20Burnable.sol                        |      100 |      100 |      100 |      100 |
  SafeERC20Ex.sol                          |      100 |      100 |      100 |      100 |
  Token.sol                                |      100 |      100 |      100 |      100 |
  TokenLibrary.sol                         |      100 |      100 |      100 |      100 |
 token/interfaces/                         |      100 |      100 |      100 |      100 |
  IERC20Burnable.sol                       |      100 |      100 |      100 |      100 |
 utility/                                  |      100 |      100 |      100 |      100 |
  BlockNumber.sol                          |      100 |      100 |      100 |      100 |
  Constants.sol                            |      100 |      100 |      100 |      100 |
  Fraction.sol                             |      100 |      100 |      100 |      100 |
  FractionLibrary.sol                      |      100 |      100 |      100 |      100 |
  MathEx.sol                               |      100 |      100 |      100 |      100 |
  Owned.sol                                |      100 |      100 |      100 |      100 |
  Time.sol                                 |      100 |      100 |      100 |      100 |
  TransparentUpgradeableProxyImmutable.sol |      100 |      100 |      100 |      100 |
  Upgradeable.sol                          |      100 |      100 |      100 |      100 |
  Utils.sol                                |      100 |      100 |      100 |      100 |
 utility/interfaces/                       |      100 |      100 |      100 |      100 |
  IOwned.sol                               |      100 |      100 |      100 |      100 |
  IUpgradeable.sol                         |      100 |      100 |      100 |      100 |
  IVersioned.sol                           |      100 |      100 |      100 |      100 |
 vaults/                                   |      100 |      100 |      100 |      100 |
  ExternalProtectionVault.sol              |      100 |      100 |      100 |      100 |
  ExternalRewardsVault.sol                 |      100 |      100 |      100 |      100 |
  MasterVault.sol                          |      100 |      100 |      100 |      100 |
  Vault.sol                                |      100 |      100 |      100 |      100 |
 vaults/interfaces/                        |      100 |      100 |      100 |      100 |
  IExternalProtectionVault.sol             |      100 |      100 |      100 |      100 |
  IExternalRewardsVault.sol                |      100 |      100 |      100 |      100 |
  IMasterVault.sol                         |      100 |      100 |      100 |      100 |
  IVault.sol                               |      100 |      100 |      100 |      100 |
-------------------------------------------|----------|----------|----------|----------|
All files                                  |    99.86 |    97.36 |      100 |    99.31 |
-------------------------------------------|----------|----------|----------|----------|

Instructions

In order to audit the test coverage of the full test suite, run:

yarn test:coverage

It’s also possible to audit the test coverage of the deployment unit-tests only (which is especially useful when verifying that any future deployments and upgrades are properly covered and tested before the DAO can consider to execute them):

yarn test:coverage:deploy

Similarly to the regular test suite, it’s als

Related Skills

View on GitHub
GitHub Stars148
CategoryCustomer
Updated10d ago
Forks49

Languages

TypeScript

Security Score

80/100

Audited on Jul 29, 2026

No findings