在合约部署之前做好迁移程序的功课。
使用事件(events)来提高数据追踪的效率。
如果你想要部署可升级合约,那么你必须准备好迁移程序,因为你的密钥可能会受到损害,或者你的合约可能会受到错误且不可逆转的操纵。
智能合约带来了新的开发范式——其不可变性要求用户重新思考搭建应用的方式,并且需要更透彻全面的设计和开发过程。
正文中涉及的链接:
[1]:https://blog.trailofbits.com/2018/09/05/contract-upgrade-anti-patterns/
[2]:https://twitter.com/Bancor/status/1016420621666963457
[3]:https://medium.com/@kickico/kickico-security-breach-issue-under-control-all-kickcoins-will-be-returned-ebe65a491dec
[4]:https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethgetstorageat
[5]:https://github.com/blockchain-etl/ethereum-etl
[6]:https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#balanceof
[7]:https://github.com/OpenZeppelin/openzeppelin-solidity/blob/03dfb2965c6a607e216b110910f9fce1c43d8c94/contracts/token/ERC20/ERC20Pausable.sol
[8]:https://github.com/blockchain-etl/ethereum-etl
[9]:https://cloud.google.com/blog/products/data-analytics/ethereum-bigquery-public-dataset-smart-contract-analytics
[10]:https://ethgasstation.info/calculatorTxV.php
[11]:https://etherscan.io/tokens
[12]:https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#allowance
[13]:https://medium.com/@AugurProject/deployment-details-rep-migration-e5413ff9fb65
[14]:https://medium.com/@vechainofficial/vechainthor-wallet-ama-5650dea84ccb
[15]:https://medium.com/tron-foundation/guide-to-independence-trx-token-migration-269302b6655c
[16]:https://blog.trailofbits.com/2018/09/05/contract-upgrade-anti-patterns/