When Serenity comes around, the network will undergo many changes, some of which may have unexpected consequences on existing Smart Contracts. How can I plan so that I am best prepared to take advantage of new features in Serenity and least likely to see unexpected bugs and security flaws?
It's not certain yet, but:
- Do NOT rely on very fine-grained calculations of current gas costs. Assume that gas costs of contract calling may go up or down by up to an order of magnitude in a future hard fork.
- If creating contracts in assembly (ie. not serpent, solidity or LLL), do NOT use dynamic JUMP/JUMPI operations (ie. every JUMP/JUMPI should be immediately preceded by a PUSH value specifying the exact point in the code to jump to)
- Do NOT do anything important based on the DIFFICULTY opcode.
- Do NOT rely on the assumption of a block time between 12-20 seconds.
- Do NOT assume that BLOCKHASHes will be a reliable source of randomness.
- Do NOT assume that tx.origin will continue to be usable or meaningful.
- Do NOT assume that opcodes other than 0xfe will continue to be invalid.
It's not certain that all of those steps will be required, or that they will be sufficient, but that should get you most of the way there.