The first BancorConverterExtensions, the lookup contract pointing Bancor converters at the current formula, gas price limit and quick converter.
Historical Significance
Part of Bancor's October 2017 contract overhaul. Its source matches commit efe39b2a42 in the bancorprotocol/contracts-solidity repository.
Key Facts
Description
An owned registry holding the addresses of the BancorFormula, BancorGasPriceLimit and BancorQuickConverter contracts, so converters could pick up upgraded versions without being redeployed. This first version, deployed 2017-10-22 at 07:11 UTC and used by BancorConverter 0xb626a5fa, was replaced the same afternoon by a version that added token withdrawal (0xf46002c3).
Source Verified
Executable runtime and creation code match the Bancor source at commit efe39b2a42 compiled with solc v0.4.16, optimizer on (200 runs). The metadata hash differs. Verified on Etherscan.
Historian Categories
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Byzantium Era
First Metropolis hard fork. Added zk-SNARK precompiles, REVERT opcode, and staticcall.
Bytecode Overview
Verified Source Available
Source code published by the original contract author.
View Verification ProofShow source code (Solidity)
{{
"language": "Solidity",
"sources": {
"BancorConverterExtensions.sol": {
"content": "// Submitted by EthereumHistory (ethereumhistory.com)\npragma solidity ^0.4.11;\nimport './Owned.sol';\nimport './Utils.sol';\nimport './interfaces/IBancorConverterExtensions.sol';\n\n/**\n @dev the BancorConverterExtensions contract is an owned contract that serves as a single point of access\n to the BancorFormula, BancorGasPriceLimit and BancorQuickConverter contracts from all BancorConverter contract instances.\n it allows upgrading these contracts without the need to update each and every\n BancorConverter contract instance individually.\n*/\ncontract BancorConverterExtensions is IBancorConverterExtensions, Owned, Utils {\n IBancorFormula public formula; // bancor calculation formula contract\n IBancorGasPriceLimit public gasPriceLimit; // bancor universal gas price limit contract\n IBancorQuickConverter public quickConverter; // bancor quick converter contract\n\n /**\n @dev constructor\n\n @param _formula address of a bancor formula contract\n @param _gasPriceLimit address of a bancor gas price limit contract\n @param _quickConverter address of a bancor quick converter contract\n */\n function BancorConverterExtensions(IBancorFormula _formula, IBancorGasPriceLimit _gasPriceLimit, IBancorQuickConverter _quickConverter)\n validAddress(_formula)\n validAddress(_gasPriceLimit)\n validAddress(_quickConverter)\n {\n formula = _formula;\n gasPriceLimit = _gasPriceLimit;\n quickConverter = _quickConverter;\n }\n\n /*\n @dev allows the owner to update the formula contract address\n\n @param _formula address of a bancor formula contract\n */\n function setFormula(IBancorFormula _formula)\n public\n ownerOnly\n validAddress(_formula)\n notThis(_formula)\n {\n formula = _formula;\n }\n\n /*\n @dev allows the owner to update the gas price limit contract address\n\n @param _gasPriceLimit address of a bancor gas price limit contract\n */\n function setGasPriceLimit(IBancorGasPriceLimit _gasPriceLimit)\n public\n ownerOnly\n validAddress(_gasPriceLimit)\n notThis(_gasPriceLimit)\n {\n gasPriceLimit = _gasPriceLimit;\n }\n\n /*\n @dev allows the owner to update the quick converter contract address\n\n @param _quickConverter address of a bancor quick converter contract\n */\n function setQuickConverter(IBancorQuickConverter _quickConverter)\n public\n ownerOnly\n validAddress(_quickConverter)\n notThis(_quickConverter)\n {\n quickConverter = _quickConverter;\n }\n}\n"
},
"Owned.sol": {
"content": "pragma solidity ^0.4.11;\nimport './interfaces/IOwned.sol';\n\n/*\n Provides support and utilities for contract ownership\n*/\ncontract Owned is IOwned {\n address public owner;\n address public newOwner;\n\n event OwnerUpdate(address _prevOwner, address _newOwner);\n\n /**\n @dev constructor\n */\n function Owned() {\n owner = msg.sender;\n }\n\n // allows execution by the owner only\n modifier ownerOnly {\n assert(msg.sender == owner);\n _;\n }\n\n /**\n @dev allows transferring the contract ownership\n the new owner still needs to accept the transfer\n can only be called by the contract owner\n\n @param _newOwner new contract owner\n */\n function transferOwnership(address _newOwner) public ownerOnly {\n require(_newOwner != owner);\n newOwner = _newOwner;\n }\n\n /**\n @dev used by a new owner to accept an ownership transfer\n */\n function acceptOwnership() public {\n require(msg.sender == newOwner);\n OwnerUpdate(owner, newOwner);\n owner = newOwner;\n newOwner = 0x0;\n }\n}\n"
},
"Utils.sol": {
"content": "pragma solidity ^0.4.11;\n\n/*\n Utilities & Common Modifiers\n*/\ncontract Utils {\n /**\n constructor\n */\n function Utils() {\n }\n\n // verifies that an amount is greater than zero\n modifier greaterThanZero(uint256 _amount) {\n require(_amount > 0);\n _;\n }\n\n // validates an address - currently only checks that it isn't null\n modifier validAddress(address _address) {\n require(_address != 0x0);\n _;\n }\n\n // verifies that the address is different than this contract address\n modifier notThis(address _address) {\n require(_address != address(this));\n _;\n }\n\n // Overflow protected math functions\n\n /**\n @dev returns the sum of _x and _y, asserts if the calculation overflows\n\n @param _x value 1\n @param _y value 2\n\n @return sum\n */\n function safeAdd(uint256 _x, uint256 _y) internal returns (uint256) {\n uint256 z = _x + _y;\n assert(z >= _x);\n return z;\n }\n\n /**\n @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number\n\n @param _x minuend\n @param _y subtrahend\n\n @return difference\n */\n function safeSub(uint256 _x, uint256 _y) internal returns (uint256) {\n assert(_x >= _y);\n return _x - _y;\n }\n\n /**\n @dev returns the product of multiplying _x by _y, asserts if the calculation overflows\n\n @param _x factor 1\n @param _y factor 2\n\n @return product\n */\n function safeMul(uint256 _x, uint256 _y) internal returns (uint256) {\n uint256 z = _x * _y;\n assert(_x == 0 || z / _x == _y);\n return z;\n }\n}\n"
},
"interfaces/IBancorConverterExtensions.sol": {
"content": "pragma solidity ^0.4.11;\nimport './IBancorFormula.sol';\nimport './IBancorGasPriceLimit.sol';\nimport './IBancorQuickConverter.sol';\n\n/*\n Bancor Converter Extensions interface\n*/\ncontract IBancorConverterExtensions {\n function formula() public constant returns (IBancorFormula) {}\n function gasPriceLimit() public constant returns (IBancorGasPriceLimit) {}\n function quickConverter() public constant returns (IBancorQuickConverter) {}\n}\n"
},
"interfaces/IBancorFormula.sol": {
"content": "pragma solidity ^0.4.11;\n\n/*\n Bancor Formula interface\n*/\ncontract IBancorFormula {\n function calculatePurchaseReturn(uint256 _supply, uint256 _reserveBalance, uint32 _reserveRatio, uint256 _depositAmount) public constant returns (uint256);\n function calculateSaleReturn(uint256 _supply, uint256 _reserveBalance, uint32 _reserveRatio, uint256 _sellAmount) public constant returns (uint256);\n}\n"
},
"interfaces/IBancorGasPriceLimit.sol": {
"content": "pragma solidity ^0.4.11;\n\n/*\n Bancor Gas Price Limit interface\n*/\ncontract IBancorGasPriceLimit {\n function gasPrice() public constant returns (uint256) {}\n}\n"
},
"interfaces/IBancorQuickConverter.sol": {
"content": "pragma solidity ^0.4.11;\nimport './IERC20Token.sol';\n\n/*\n Bancor Quick Converter interface\n*/\ncontract IBancorQuickConverter {\n function quickConvert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn) public returns (uint256);\n}\n"
},
"interfaces/IERC20Token.sol": {
"content": "pragma solidity ^0.4.11;\n\n/*\n ERC20 Standard Token interface\n*/\ncontract IERC20Token {\n // these functions aren't abstract since the compiler emits automatically generated getter functions as external\n function name() public constant returns (string) {}\n function symbol() public constant returns (string) {}\n function decimals() public constant returns (uint8) {}\n function totalSupply() public constant returns (uint256) {}\n function balanceOf(address _owner) public constant returns (uint256) { _owner; }\n function allowance(address _owner, address _spender) public constant returns (uint256) { _owner; _spender; }\n\n function transfer(address _to, uint256 _value) public returns (bool success);\n function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);\n function approve(address _spender, uint256 _value) public returns (bool success);\n}\n"
},
"interfaces/IOwned.sol": {
"content": "pragma solidity ^0.4.11;\n\n/*\n Owned contract interface\n*/\ncontract IOwned {\n // this function isn't abstract since the compiler emits automatically generated getter functions as external\n function owner() public constant returns (address) {}\n\n function transferOwnership(address _newOwner) public;\n function acceptOwnership() public;\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}External Links
Related contracts
Bancor
Same deployerBancor Network Token (BNT), the first Bancor Smart Token, deployed 2017-06-10 ahead of the Bancor crowdsale.
0x1f573d...a7ff1cJune 10, 2017CrowdsaleController
Same deployerThe Bancor crowdsale contract. Opened 2017-06-12 and collected 396,619.89 ETH, about $153M at the time.
0xbbc797...f89710June 10, 2017BancorFormula
Same deployerThe original Bancor pricing formula, computing purchase and sale returns for Smart Tokens from supply, reserve and reserve ratio.
0x8d10c0...395b98June 22, 2017Ether Token
Same deployerBancor's ETH wrapper token, used as the ETH reserve of the original BNT converter.
0xd76b5c...b746aeJune 22, 2017BancorChanger
Same deployerThe original Bancor converter for BNT, deployed 2017-06-22 with an ETH reserve held as EtherToken.
0xca83bd...629ff4June 22, 2017BancorPriceFloor
Same deployerA contract that bought back BNT for ETH at the 0.01 ETH crowdsale price, deployed 2017-06-25.
0x7ec6a7...268549June 25, 2017