For ERC-20 Tokens, we have created a smart contract that can be used to upgrade the converter of a Relay Token in a single atomic action. We highly recommend you upgrade your converters regularly for security reasons, and to support any other product improvements that could lead to gas cost reduction, etc.
New converter upgrades will be announced in the Bancor Developers Telegram Group.
You will need:
- [Original Converter Address]
- Find your relay token on etherscan
- Click the "read contract" tab
- Go to "owner"
- This is the address of the converter currently used and the one we would like to upgrade.
- Access to the wallet that owns the original converter
- [BancorConverterUpgrader] contract address
- Go to our registry https://etherscan.io/address/0x52Ae12ABe5D8BD778BD5397F99cA900624CfADD4#readContract
- Scroll to point 3 and enter “BancorConverterUpgrader” to receive the latest address to use
Step 1 - Transfer Converter Ownership
First step is to transfer the converter ownership to the BancorConverterUpgrader smart contract. This will then allow you to execute the entire upgrade process with a single transaction.
- Go to mycrypto.com (always use a trusted endpoint to execute transactions)
- Click “Contracts” in the top navigation menu
- Paste the following:
- Contract Address: [Current Converter Address]
- ABI / JSON Interface:
- Copy/paste the ABI from this URL:
- https://etherscan.io/address/[Current Converter Address]#code
- Click “Access”
- Scroll down to the next step
- Select the “transferOwnership” function from the drop down
- Enter the “BancorConverterUpgrader” contract address under _newOwner: [BancorConverterUpgrader]
- Sign in to your wallet (this must be the wallet that owns the converter)
- Click “Write”
- Proceed to Step 2
Step 2 - Converter Upgrade
What this smart contract does:
- New converter is created with the same values as the old converter in terms of supply, conversion fee, connector tokens and weight
- Moves connector balances from old converter to new one
- Transfers Relay Token ownership to the new converter (this will assure all transactions of the Relay Token will work with the new converter)
- Transfer the old and new converter ownership to the original owner
Important - when using the BancorConverterUpgrader, your users will experience NO down time!
Estimate Gas cost is roughly 0.03 ETH
Execution Process
- Go to mycrypto.com (always use a trusted endpoint to execute transactions)
- Click “Contracts” in the top navigation menu
- Paste the following:
- Enter the “BancorConverterUpgrader” contract address under Contract Address:
[BancorConverterUpgrader] - ABI / JSON Interface:
Copy/paste the ABI from this URL: https://raw.githubusercontent.com/bancorprotocol/contracts/master/solidity/build/BancorConverterUpgrader.abi - Click “Access”
- Scroll down and you will see the next step
- Select the “upgradeOld” function from the drop down
- Enter the following:
- _converter = [Original Converter Address]
- _version = 0x302e37 (if you use parity, replace this value with 0.7)
- Sign with your wallet (this must be the wallet that owns the old converter)
- Click “Write”
- View the transaction on etherscan and keep it open once confirmed. You will need this for the next step.
- Proceed to Step 3
Once this function is confirmed on the blockchain, the following will happen:
- Your converter will be upgraded to the latest version
- Your Relay Token will be available for conversion (there will be NO down time)
- You will receive ownership of both the old and new converters
*****listen to etherscan
Step 3 - Accept ownership and management
At this stage, you will need to accept back the ownership over the converter (both old and new) from the Smart Contract.
For this you will need to go to the address of the converter and execute the function “accept ownership”
Process:
- On the upgrade action view on etherscan, click the “Event Logs” tab
- Scroll all the way to the bottom. Here you will see 3 values:
- Value [0] - hash data. You can ignore this part
- Value [1] - address of your original converter (should equal [New Converter Address])
- Value [2] - address of your new converter.
Both [1] and [2] will be in a slightly different format from a normal address, simply copy the 40 rightmost numbers and add 0x to the beginning.
Example:
[1] 0x000000000000000000000000836c1b5ad499b0ff00d9ec13cc0ad97a1dba25d1
Address will be: 0x836c1b5ad499b0ff00d9ec13cc0ad97a1dba25d1
- Go back to mycrypto.com
- Open contract tab
- Enter the [Original Converter Address]
- ABI from this URL: https://raw.githubusercontent.com/bancorprotocol/contracts/master/solidity/build/BancorConverter.abi
- Click “Access”
- In the drop down menu, select “acceptOwnership”
- Click “Write”
- Go to the drop down menu again, now select the action “acceptManagement”
- Click “Write”
- Repeat steps 5-11 only this time using the address of the new converter (2.c)
- Done!