tokenbridge-contracts/contracts/upgradeability
Gerardo Nardelli 67e536f312
Remove contracts and build for spuriousDragon (#456)
2020-07-27 22:26:22 +03:00
..
EternalStorage.sol Add Solhint solidity linter (#240) 2019-07-22 07:19:24 +03:00
EternalStorageProxy.sol Fix EternalStorageProxy inheritance (#254) 2019-07-31 08:32:37 +02:00
OwnedUpgradeabilityProxy.sol Increase code coverage (#250) 2019-08-01 14:36:46 +02:00
Proxy.sol Increase code coverage (#250) 2019-08-01 14:36:46 +02:00
README.md Remove contracts and build for spuriousDragon (#456) 2020-07-27 22:26:22 +03:00
UpgradeabilityOwnerStorage.sol Add Solhint solidity linter (#240) 2019-07-22 07:19:24 +03:00
UpgradeabilityProxy.sol Documentation for upgradeability contracts (#332) 2019-12-27 15:52:03 +04:00
UpgradeabilityStorage.sol Minor fixes on contracts (#260) 2019-08-01 23:35:56 +02:00

README.md

Upgradeability contracts

This directory contains contracts needed for the idea of upgradeable contracts. The source code for this contracts was originally taken from openzeppelin-labs repository.

Since the original code is not recommended for production use, it is not directly imported into this project.

During the development process and performing security audits, the following minor changes were introduced:

  • Required solidity compiler version was fixed at 0.4.24, since this version is used in the source code of other contracts. Deprecated syntax for constructors and emitting events was also updated to a new one.
  • Access modifier onlyProxyOwner was renamed to onlyUpgradeabilityOwner. Function calls to proxyOwner() in OwnedUpgradeabilityProxy.sol were directly replaced by calls to upgradeabilityOwner(), in order to avoid possible ambiguity. See #195.
  • Functions modifier public was replaced by external where possible.
  • Version field type was changed from string to uint256, as it reduces possible complexity and allows to easily introduce a version mutability requirement (require(version > _version); in UpgradeabilityProxy.sol).
  • Additional assembly operation was introduced in Proxy.sol, opcodes in line mstore(0x40, add(ptr, returndatasize)) guarantee the correct value of free memory pointer for execution of next instructions.
  • Additional check in UpgradeabilityProxy.sol was added, require(AddressUtils.isContract(implementation)) verifies that new implementation is not a regular address, but a contract. See #256.