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-v3Installs into whichever agent you are using.
README

Bancor Protocol Contracts v3.0 (Dawn Release)
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
- PeckShield
- OpenZeppelin
- ChainSecurity
- OpenZeppelin AutoCompoundingRewards
- Certora (coming soon...)
- ChainSecurity (coming soon...)
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

-------------------------------------------|----------|----------|----------|----------|
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
gortex
1.1kHigh-performance code-intelligence engine for AI agents and IDE, supports 257 languages, multi repositories, based on graph, with access via CLI, MCP Server, and API. AI coding agents teammate - expose only needed information, cutting token usage up to 50x. 100% local.
techrogue
TechRogue – Roguelike technical quiz for engineers. Usage: /techrogue | /techrogue build | /techrogue settings
cc-switch
125.6kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
cc-switch
125.7kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
