Bancor Network is composed of multiple smart contracts that are working together to provide a complete solution to on-chain liquidity.
Most of these contracts are occasionally upgraded and thus, their address changes.
The network also includes a contract address discovery mechanism - a contract that servers as a registry for all the core contracts, that allows querying the latest contract addresses by their names.
In order to always work with the latest version and ensure that production code doesn't break, contract addresses should always be referenced by first querying the contract registry.
The only exception is the contract registry itself, whose address rarely changes, if at all.
For example, to get the latest contract address of the BancorNetwork contract, the following call should be used:
bancorNetwork = ContractRegistry.addressOf('BancorNetwork')
addressOf function can receive any of the known contract names as an argument, in bytes32 format. Below is a list of all core contract names with their bytes32 representation:
Below are the Bancor Network contract addresses that cannot be retrieved from the contract registry: