Devcon2 Token Upgrade

Piper Merriam
3 min readNov 17, 2016

--

I’ve spend the last few weeks hammering away at upgrading the Devcon2 Tokens. The original contract was written during the morning of the first day of the conference and some of the architectural decisions I made that morning haven’t sat well with me. You can see the source code here.

Abusing ERC20

I had the clever idea to make the contract compliant with ERC20 token standard. I wanted the tokens to be differentiated from one another so I assigned each token a bytes32 identifier which was the sha3 of whatever string a person gave me to register with their token. Given that I was shooting for compliance with the token standard I decided it would be easy to just have each account’s balance be the integer representation of that bytes32 value. The end result for this ended up not being very ideal.

While the contract is totally compliant with the token standard, it isn’t exactly intuitive. For example, if you were to query the balance of my account 0xd3CdA913deB6f67967B99D67aCDFa1712C293601 you would see that it returns 111187533211095240011240229590045459692043680141859564288186792905851225605798. To compound the issue, if I want to transfer my token, then I have to execute a transfer for this full balance and providing any other value will cause the transfer to fail. Like most clever ideas, this one fell short a bit.

Phase 1: Upgrading Your Token

Today I’m excited to publish an upgrade to this contract. You can it @ 0xdd94De9cFE063577051A5eb7465D08317d8808B6. You can upgrade your token today via the https://www.devcon2-token.com/ site. If you have issues or questions about upgrading please open an issue here.

If you would like to upgrade your token manually you can do so simply by sending a transaction to the contract with the input data 0xd55ec697 which is the upgrade() function. You can also upgrade using the Ethereum Wallet by importing the ABI found here.

The new contract has a sane ERC20 implementation that fixes the awkwardness of the original one. Account balances are now always 1 or 0 depending on if you own a token or not and transferring tokens is a simple as transferring 1 token to another account. No more giant misleading account balances.

I’ve reached out to the operators of etherscan to get this new contract verified and listed under their ERC tokens. This release is the first step in something bigger that I’m going to be chipping away at over the next year.

Phase 2: Web of Trust Token

The idea behind this next phase is that the current group of people that hold devcon2 tokens is restricted to those that were able to travel to China and attend the conference. This set is a subset of the community that I’m actually interested in, the broader Ethereum community.

The first Web-Of-Trust token contract will allow anyone who has an upgraded devcon2 token to issue a very small number of Trust tokens as well as claiming a single Trust token for themselves. The goal is to expand the current set of token holders to a more broad and inclusive subset of the Ethereum community.

Phase 3: Profit?

I’m pretty sure phase 3 is always “profit”. Does that mean I have to change phase 1 to “collect underpants”?

It’s not entirely set what comes next. I have ideas but they aren’t yet fully formed. In the short term I’ll probably be adding some functionality to https://www.devcon2-token.com that facilitates transfering tokens. I’m also looking at integrating it with uPort so that the contract can attest to you being at devcon2. I also might try and replace /r/ethereum….

--

--