Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gaps at the end of the storage of each contract. #29

Merged
merged 2 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contracts/Initializable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ contract Initializable {
assembly { cs := extcodesize(address) }
return cs == 0;
}

uint256[50] private ______gap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will be removing Initializable and loading it from zos-lib afterwards, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - should we add this there?

}
2 changes: 2 additions & 0 deletions contracts/access/roles/CapperRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ contract CapperRole is Initializable {
cappers.remove(account);
emit CapperRemoved(account);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/access/roles/MinterRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ contract MinterRole is Initializable {
minters.remove(account);
emit MinterRemoved(account);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/access/roles/PauserRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ contract PauserRole is Initializable {
pausers.remove(account);
emit PauserRemoved(account);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/access/roles/SignerRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ contract SignerRole is Initializable {
signers.remove(account);
emit SignerRemoved(account);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/Crowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,6 @@ contract Crowdsale is Initializable {
function _forwardFunds() internal {
_wallet.transfer(msg.value);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/distribution/FinalizableCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ contract FinalizableCrowdsale is Initializable, TimedCrowdsale {
function _finalization() internal {
}


uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ contract PostDeliveryCrowdsale is Initializable, TimedCrowdsale {
_balances[beneficiary] = _balances[beneficiary].add(tokenAmount);
}


uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/distribution/RefundableCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@ contract RefundableCrowdsale is Initializable, FinalizableCrowdsale {
_escrow.deposit.value(msg.value)(msg.sender);
}


uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/emission/AllowanceCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ contract AllowanceCrowdsale is Initializable, Crowdsale {
{
token().safeTransferFrom(_tokenWallet, beneficiary, tokenAmount);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/emission/MintedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ contract MintedCrowdsale is Initializable, Crowdsale {
require(
ERC20Mintable(address(token())).mint(beneficiary, tokenAmount));
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ contract IncreasingPriceCrowdsale is Initializable, TimedCrowdsale {
return currentRate.mul(weiAmount);
}


uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/validation/CappedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ contract CappedCrowdsale is Initializable, Crowdsale {
require(weiRaised().add(weiAmount) <= _cap);
}


uint256[50] private ______gap;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ contract IndividuallyCappedCrowdsale is Initializable, Crowdsale, CapperRole {
weiAmount);
}


uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/crowdsale/validation/TimedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,6 @@ contract TimedCrowdsale is Initializable, Crowdsale {
super._preValidatePurchase(beneficiary, weiAmount);
}


uint256[50] private ______gap;
}
4 changes: 4 additions & 0 deletions contracts/drafts/BreakInvariantBounty.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ contract BreakInvariantBounty is Initializable, PullPayment, Ownable {
*/
function _deployContract() internal returns(address);


uint256[50] private ______gap;
}


Expand All @@ -91,4 +93,6 @@ contract Target {
* @return True if all invariant values are correct, false otherwise.
*/
function checkInvariant() public returns(bool);

uint256[50] private ______gap;
}
4 changes: 4 additions & 0 deletions contracts/drafts/ERC1046/TokenMetadata.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import "../../token/ERC20/IERC20.sol";
*/
contract ERC20TokenMetadata is Initializable, IERC20 {
function tokenURI() external view returns (string);

uint256[50] private ______gap;
}


Expand All @@ -28,4 +30,6 @@ contract ERC20WithMetadata is Initializable, ERC20TokenMetadata {
function tokenURI() external view returns (string) {
return _tokenURI;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/drafts/ERC20Migrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ contract ERC20Migrator is Initializable {
uint256 amount = Math.min(balance, allowance);
migrate(account, amount);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/drafts/SignatureBouncer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,6 @@ contract SignatureBouncer is Initializable, SignerRole {

return signer != address(0) && isSigner(signer);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/drafts/TokenVesting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,6 @@ contract TokenVesting is Initializable, Ownable {
return totalBalance.mul(block.timestamp.sub(_start)).div(_duration);
}
}

uint256[50] private ______gap;
}
4 changes: 4 additions & 0 deletions contracts/examples/SampleCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ contract SampleCrowdsaleToken is Initializable, ERC20Mintable {
symbol = "SCT";
decimals = 18;
}

uint256[50] private ______gap;
}


Expand Down Expand Up @@ -67,4 +69,6 @@ contract SampleCrowdsale is Initializable, Crowdsale, CappedCrowdsale, Refundabl
//the value needs to less or equal than a cap which is limit for accepted funds
require(goal <= cap);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/examples/SimpleToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ contract SimpleToken is Initializable, ERC20 {
_mint(sender, INITIAL_SUPPLY);
}


uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/introspection/ERC165.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ contract ERC165 is Initializable, IERC165 {
require(interfaceId != 0xffffffff);
_supportedInterfaces[interfaceId] = true;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/lifecycle/Pausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@ contract Pausable is Initializable, PauserRole {
_paused = false;
emit Unpaused();
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/ownership/Ownable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,6 @@ contract Ownable is Initializable {
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/ownership/Secondary.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ contract Secondary is Initializable {

_primary = recipient;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/payment/ConditionalEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ contract ConditionalEscrow is Initializable, Escrow {
require(withdrawalAllowed(payee));
super.withdraw(payee);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/payment/Escrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ contract Escrow is Initializable, Secondary {

emit Withdrawn(payee, payment);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/payment/PullPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ contract PullPayment is Initializable {
function _asyncTransfer(address dest, uint256 amount) internal {
_escrow.deposit.value(amount)(dest);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/payment/RefundEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ contract RefundEscrow is Initializable, ConditionalEscrow {
function withdrawalAllowed(address payee) public view returns (bool) {
return _state == State.Refunding;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/payment/SplitPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,6 @@ contract SplitPayment is Initializable {
_shares[account] = shares_;
_totalShares = _totalShares.add(shares_);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC20/ERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,6 @@ contract ERC20 is Initializable, IERC20 {
amount);
_burn(account, amount);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC20/ERC20Burnable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ contract ERC20Burnable is Initializable, ERC20 {
function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC20/ERC20Capped.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ contract ERC20Capped is Initializable, ERC20Mintable {
return super.mint(to, amount);
}


uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC20/ERC20Detailed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ contract ERC20Detailed is Initializable, IERC20 {
function decimals() public view returns(uint8) {
return _decimals;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC20/ERC20Mintable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ contract ERC20Mintable is Initializable, ERC20, MinterRole {
_mint(to, amount);
return true;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC20/ERC20Pausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ contract ERC20Pausable is Initializable, ERC20, Pausable {
{
return super.decreaseAllowance(spender, subtractedValue);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC20/TokenTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ contract TokenTimelock is Initializable {

_token.safeTransfer(_beneficiary, amount);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,6 @@ contract ERC721 is Initializable, ERC165, IERC721 {
msg.sender, from, tokenId, _data);
return (retval == _ERC721_RECEIVED);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721Burnable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ contract ERC721Burnable is Initializable, ERC721 {
require(_isApprovedOrOwner(msg.sender, tokenId));
_burn(ownerOf(tokenId), tokenId);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721Enumerable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,6 @@ contract ERC721Enumerable is Initializable, ERC165, ERC721, IERC721Enumerable {
_allTokensIndex[tokenId] = 0;
_allTokensIndex[lastToken] = tokenIndex;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721Full.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ contract ERC721Full is Initializable, ERC721, ERC721Enumerable, ERC721Metadata {
ERC721Enumerable.initialize();
ERC721Metadata.initialize(name, symbol);
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721Holder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ contract ERC721Holder is Initializable, IERC721Receiver {
{
return this.onERC721Received.selector;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721Metadata.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ contract ERC721Metadata is Initializable, ERC165, ERC721, IERC721Metadata {
delete _tokenURIs[tokenId];
}
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721MetadataMintable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ contract ERC721MetadataMintable is Initializable, ERC721, ERC721Metadata, Minter
_setTokenURI(tokenId, tokenURI);
return true;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721Mintable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ contract ERC721Mintable is Initializable, ERC721, MinterRole {
_mint(to, tokenId);
return true;
}

uint256[50] private ______gap;
}
2 changes: 2 additions & 0 deletions contracts/token/ERC721/ERC721Pausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ contract ERC721Pausable is Initializable, ERC721, Pausable {
{
super.transferFrom(from, to, tokenId);
}

uint256[50] private ______gap;
}
1 change: 0 additions & 1 deletion contracts/utils/Address.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ library Address {
assembly { size := extcodesize(account) }
return size > 0;
}

}
1 change: 1 addition & 0 deletions contracts/utils/ReentrancyGuard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ contract ReentrancyGuard is Initializable {
require(localCounter == _guardCounter);
}

uint256[50] private ______gap;
}