fix multi-inheritance ordering w/ most base-like coming first, and reserve storage slots for future upgrades

This commit is contained in:
perissology 2018-02-15 15:42:19 -08:00
parent 93e910cc97
commit cdf8f609cc
5 changed files with 9 additions and 3 deletions

View File

@ -36,6 +36,7 @@ contract EscapableApp is AragonApp {
address public escapeHatchDestination;
mapping (address=>bool) private escapeBlacklist; // Token contract addresses
uint[20] private storageOffset; // reserve 20 slots for future upgrades
/// @param _escapeHatchDestination The address of a safe location (usu a
/// Multisig) to send the ether held in this contract; if a neutral address

View File

@ -27,7 +27,7 @@ import "./EscapableApp.sol";
/// @dev `LiquidPledgingBase` is the base level contract used to carry out
/// liquidPledging's most basic functions, mostly handling and searching the
/// data structures
contract LiquidPledgingBase is LiquidPledgingStorage, PledgeAdmins, Pledges, EscapableApp {
contract LiquidPledgingBase is EscapableApp, LiquidPledgingStorage, PledgeAdmins, Pledges {
// Event Declarations
event Transfer(uint indexed from, uint indexed to, uint amount);

View File

@ -25,7 +25,7 @@ import "./LiquidPledgingStorage.sol";
/// NOTICE: This contract is not using EternalStorage. This is done to save gas. The pluginWhitelist
/// should be fairly small, and would be trivial and relatively cheap to re-add all valid plugins
/// when the LiquidPledging contract is upgraded
contract LiquidPledgingPlugins is LiquidPledgingStorage, AragonApp {
contract LiquidPledgingPlugins is AragonApp, LiquidPledgingStorage {
bytes32 constant public PLUGIN_MANAGER_ROLE = keccak256("PLUGIN_MANAGER_ROLE");

View File

@ -54,4 +54,9 @@ contract LiquidPledgingStorage {
bool public whitelistDisabled = false;
ILPVault public vault;
// reserve 50 slots for future upgrades. I'm not sure if this is necessary
// but b/c of multiple inheritance used in lp, better safe then sorry.
// especially since it is free
uint[50] private storageOffset;
}

View File

@ -22,7 +22,7 @@ pragma solidity ^0.4.18;
import "@aragon/os/contracts/apps/AragonApp.sol";
import "./LiquidPledgingStorage.sol";
contract Pledges is LiquidPledgingStorage, AragonApp {
contract Pledges is AragonApp, LiquidPledgingStorage {
// Limits inserted to prevent large loops that could prevent canceling
uint constant MAX_DELEGATES = 10;