Make most constants and storage vars uint256

This commit is contained in:
Amir Bandeali
2019-08-27 16:55:51 -07:00
parent 9fb933fd06
commit aabca97b2d
4 changed files with 28 additions and 13 deletions

View File

@@ -24,7 +24,6 @@ import "./MixinDeploymentConstants.sol";
contract MixinConstants is
MixinDeploymentConstants
{
uint256 constant internal TOKEN_MULTIPLIER = 1000000000000000000; // 10**18
// The upper 16 bytes represent the pool id, so this would be pool id 1. See MixinStakinPool for more information.

View File

@@ -23,9 +23,9 @@ contract MixinDeploymentConstants {
// @TODO SET THESE VALUES FOR DEPLOYMENT
uint64 constant internal EPOCH_DURATION_IN_SECONDS = 1000;
uint256 constant internal EPOCH_DURATION_IN_SECONDS = 1000;
uint64 constant internal TIMELOCK_DURATION_IN_EPOCHS = 3;
uint256 constant internal TIMELOCK_DURATION_IN_EPOCHS = 3;
uint256 constant internal COBB_DOUGLAS_ALPHA_DENOMINATOR = 6;

View File

@@ -19,9 +19,9 @@
pragma solidity ^0.5.9;
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "./MixinConstants.sol";
import "../interfaces/IZrxVault.sol";
import "../interfaces/IStakingPoolRewardVault.sol";
import "./MixinConstants.sol";
import "../interfaces/IStructs.sol";
@@ -32,13 +32,10 @@ contract MixinStorage is
Ownable
{
/// @dev Constructor asserts that all storage variables are in expected slots.
constructor(address _stakingContract)
constructor()
public
Ownable()
{
stakingContract = _stakingContract;
}
{}
// address of staking contract
address internal stakingContract;
@@ -78,16 +75,16 @@ contract MixinStorage is
mapping (bytes32 => address[]) internal makerAddressesByPoolId;
// current epoch
uint64 internal currentEpoch = INITIAL_EPOCH;
uint256 internal currentEpoch = INITIAL_EPOCH;
// current epoch start time
uint64 internal currentEpochStartTimeInSeconds;
uint256 internal currentEpochStartTimeInSeconds;
// current withdrawal period
uint64 internal currentTimeLockPeriod = INITIAL_TIMELOCK_PERIOD;
uint256 internal currentTimeLockPeriod = INITIAL_TIMELOCK_PERIOD;
// current epoch start time
uint64 internal currentTimeLockPeriodStartEpoch = INITIAL_EPOCH;
uint256 internal currentTimeLockPeriodStartEpoch = INITIAL_EPOCH;
// fees collected this epoch
mapping (bytes32 => uint256) internal protocolFeesThisEpochByPool;

View File

@@ -0,0 +1,19 @@
import { blockchainTests, expect } from '@0x/contracts-test-utils';
import { artifacts, TestStorageLayoutContract } from '../src';
blockchainTests.resets('Storage layout tests', env => {
let testStorageLayoutContract: TestStorageLayoutContract;
before(async () => {
testStorageLayoutContract = await TestStorageLayoutContract.deployFrom0xArtifactAsync(
artifacts.TestStorageLayout,
env.provider,
env.txDefaults,
{},
);
});
it('should have the correct storage slots', async () => {
return expect(testStorageLayoutContract.assertExpectedStorageLayout.callAsync()).to.be.fulfilled('');
});
});