Skip to content

Commit

Permalink
Merge pull request #87 from maticnetwork/halborn-audit-fix
Browse files Browse the repository at this point in the history
Halborn Audit Fix
  • Loading branch information
jdkanani committed Aug 5, 2021
2 parents d062711 + 959e46b commit dabb08e
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 13 deletions.
2 changes: 1 addition & 1 deletion contracts/child/ChildToken/UpgradeableChildERC20/ERC20.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity 0.6.6;


import "@openzeppelin/contracts/GSN/Context.sol";
Expand Down
6 changes: 4 additions & 2 deletions contracts/root/RootChainManager/RootChainManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ contract RootChainManager is
external
only(DEFAULT_ADMIN_ROLE)
{
require(newStateSender != address(0), "RootChainManager: BAD_NEW_STATE_SENDER");
_stateSender = IStateSender(newStateSender);
}

Expand All @@ -115,6 +116,7 @@ contract RootChainManager is
external
only(DEFAULT_ADMIN_ROLE)
{
require(newCheckpointManager != address(0), "RootChainManager: BAD_NEW_CHECKPOINT_MANAGER");
_checkpointManager = ICheckpointManager(newCheckpointManager);
}

Expand All @@ -140,7 +142,7 @@ contract RootChainManager is
}

/**
* @notice Register a token predicate address against its type, callable only by mappers
* @notice Register a token predicate address against its type, callable only by ADMIN
* @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens
* @param tokenType bytes32 unique identifier for the token type
* @param predicateAddress address of token predicate address
Expand Down Expand Up @@ -192,7 +194,7 @@ contract RootChainManager is

/**
* @notice Remap a token that has already been mapped, properly cleans up old mapping
* Callable only by mappers
* Callable only by ADMIN
* @param rootToken address of token on root chain
* @param childToken address of token on child chain
* @param tokenType bytes32 unique identifier for the token type
Expand Down
3 changes: 3 additions & 0 deletions contracts/root/RootToken/DummyERC1155.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
Expand Down
3 changes: 3 additions & 0 deletions contracts/root/RootToken/DummyERC20.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
Expand Down
3 changes: 3 additions & 0 deletions contracts/root/RootToken/DummyERC721.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
Expand Down
3 changes: 3 additions & 0 deletions contracts/root/RootToken/DummyMintableERC1155.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
Expand Down
3 changes: 3 additions & 0 deletions contracts/root/RootToken/DummyMintableERC20.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
Expand Down
3 changes: 3 additions & 0 deletions contracts/root/RootToken/DummyMintableERC721.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/tunnel/BaseRootTunnel.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.6;
pragma solidity 0.6.6;


import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
Expand Down Expand Up @@ -44,6 +44,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {
external
only(DEFAULT_ADMIN_ROLE)
{
require(newStateSender != address(0), "RootTunnel: BAD_NEW_STATE_SENDER");
stateSender = IStateSender(newStateSender);
}

Expand All @@ -56,6 +57,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {
external
only(DEFAULT_ADMIN_ROLE)
{
require(newCheckpointManager != address(0), "RootTunnel: BAD_NEW_CHECKPOINT_MANAGER");
checkpointManager = ICheckpointManager(newCheckpointManager);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/tunnel/ChildTunnel.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.6;
pragma solidity 0.6.6;

import {BaseChildTunnel} from "./BaseChildTunnel.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/tunnel/RootTunnel.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.6;
pragma solidity 0.6.6;

import {BaseRootTunnel} from "./BaseRootTunnel.sol";

Expand Down
4 changes: 3 additions & 1 deletion flat/BaseRootTunnel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ library Merkle {

// File: contracts/tunnel/BaseRootTunnel.sol

pragma solidity ^0.6.6;
pragma solidity 0.6.6;



Expand Down Expand Up @@ -1362,6 +1362,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {
external
only(DEFAULT_ADMIN_ROLE)
{
require(newStateSender != address(0), "RootTunnel: BAD_NEW_STATE_SENDER");
stateSender = IStateSender(newStateSender);
}

Expand All @@ -1374,6 +1375,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {
external
only(DEFAULT_ADMIN_ROLE)
{
require(newCheckpointManager != address(0), "RootTunnel: BAD_NEW_CHECKPOINT_MANAGER");
checkpointManager = ICheckpointManager(newCheckpointManager);
}

Expand Down
2 changes: 1 addition & 1 deletion flat/ChildTunnel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ abstract contract BaseChildTunnel is AccessControlMixin {

// File: contracts/tunnel/ChildTunnel.sol

pragma solidity ^0.6.6;
pragma solidity 0.6.6;



Expand Down
3 changes: 3 additions & 0 deletions flat/DummyERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,9 @@ abstract contract ContextMixin {

// File: contracts/root/RootToken/DummyERC1155.sol

// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;


Expand Down
3 changes: 3 additions & 0 deletions flat/DummyERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,9 @@ abstract contract ContextMixin {

// File: contracts/root/RootToken/DummyERC20.sol

// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;


Expand Down
3 changes: 3 additions & 0 deletions flat/DummyERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,9 @@ abstract contract ContextMixin {

// File: contracts/root/RootToken/DummyERC721.sol

// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;


Expand Down
3 changes: 3 additions & 0 deletions flat/DummyMintableERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,9 @@ contract AccessControlMixin is AccessControl {

// File: contracts/root/RootToken/DummyMintableERC1155.sol

// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;


Expand Down
3 changes: 3 additions & 0 deletions flat/DummyMintableERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,9 @@ contract AccessControlMixin is AccessControl {

// File: contracts/root/RootToken/DummyMintableERC20.sol

// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;


Expand Down
3 changes: 3 additions & 0 deletions flat/DummyMintableERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,9 @@ abstract contract ContextMixin {

// File: contracts/root/RootToken/DummyMintableERC721.sol

// This contract is not supposed to be used in production
// It's strictly for testing purpose

pragma solidity 0.6.6;


Expand Down
6 changes: 4 additions & 2 deletions flat/RootChainManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1742,6 +1742,7 @@ contract RootChainManager is
external
only(DEFAULT_ADMIN_ROLE)
{
require(newStateSender != address(0), "RootChainManager: BAD_NEW_STATE_SENDER");
_stateSender = IStateSender(newStateSender);
}

Expand All @@ -1762,6 +1763,7 @@ contract RootChainManager is
external
only(DEFAULT_ADMIN_ROLE)
{
require(newCheckpointManager != address(0), "RootChainManager: BAD_NEW_CHECKPOINT_MANAGER");
_checkpointManager = ICheckpointManager(newCheckpointManager);
}

Expand All @@ -1787,7 +1789,7 @@ contract RootChainManager is
}

/**
* @notice Register a token predicate address against its type, callable only by mappers
* @notice Register a token predicate address against its type, callable only by ADMIN
* @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens
* @param tokenType bytes32 unique identifier for the token type
* @param predicateAddress address of token predicate address
Expand Down Expand Up @@ -1839,7 +1841,7 @@ contract RootChainManager is

/**
* @notice Remap a token that has already been mapped, properly cleans up old mapping
* Callable only by mappers
* Callable only by ADMIN
* @param rootToken address of token on root chain
* @param childToken address of token on child chain
* @param tokenType bytes32 unique identifier for the token type
Expand Down
6 changes: 4 additions & 2 deletions flat/RootTunnel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ library Merkle {

// File: contracts/tunnel/BaseRootTunnel.sol

pragma solidity ^0.6.6;
pragma solidity 0.6.6;



Expand Down Expand Up @@ -1362,6 +1362,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {
external
only(DEFAULT_ADMIN_ROLE)
{
require(newStateSender != address(0), "RootTunnel: BAD_NEW_STATE_SENDER");
stateSender = IStateSender(newStateSender);
}

Expand All @@ -1374,6 +1375,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {
external
only(DEFAULT_ADMIN_ROLE)
{
require(newCheckpointManager != address(0), "RootTunnel: BAD_NEW_CHECKPOINT_MANAGER");
checkpointManager = ICheckpointManager(newCheckpointManager);
}

Expand Down Expand Up @@ -1536,7 +1538,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {

// File: contracts/tunnel/RootTunnel.sol

pragma solidity ^0.6.6;
pragma solidity 0.6.6;



Expand Down
2 changes: 1 addition & 1 deletion flat/UChildERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ library Address {

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity 0.6.6;



Expand Down

0 comments on commit dabb08e

Please sign in to comment.