From 10ea3d111b7d752489fd9927dcb6248e4e12e90e Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 5 Aug 2019 15:21:16 -0400 Subject: [PATCH] Update to solidity > 0.5.0 --- contracts/LibSubmarineSimple.sol | 18 +++++++++--------- contracts/LibSubmarineSimpleTestHelper.sol | 6 +++--- .../examples/erc721_auction/ERC721Auction.sol | 2 +- .../erc721_auction/ERC721AuctionSubmarine.sol | 2 +- contracts/examples/exchange/ERC20Interface.sol | 4 ++-- contracts/examples/exchange/Exchange.sol | 2 +- contracts/examples/exchange/TestToken.sol | 2 +- contracts/openzeppelin-solidity | 2 +- proveth | 2 +- test/test_LibSubmarineSimple.py | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/contracts/LibSubmarineSimple.sol b/contracts/LibSubmarineSimple.sol index 4eaacf7..a6e41b8 100644 --- a/contracts/LibSubmarineSimple.sol +++ b/contracts/LibSubmarineSimple.sol @@ -1,8 +1,8 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "./openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./proveth/ProvethVerifier.sol"; -import "./proveth/RLP.sol"; +import "./proveth/Solidity-RLP/contracts/RLPReader.sol"; contract LibSubmarineSimple is ProvethVerifier { @@ -86,7 +86,7 @@ contract LibSubmarineSimple is ProvethVerifier { address _user, address _libsubmarine, uint256 _commitValue, - bytes _embeddedDAppData, + bytes memory _embeddedDAppData, bytes32 _witness, uint256 _gasPrice, uint256 _gasLimit @@ -178,7 +178,7 @@ contract LibSubmarineSimple is ProvethVerifier { */ function onSubmarineReveal( bytes32 _submarineId, - bytes _embeddedDAppData, + bytes memory _embeddedDAppData, uint256 _value ) internal; @@ -197,10 +197,10 @@ contract LibSubmarineSimple is ProvethVerifier { */ function reveal( uint32 _commitTxBlockNumber, - bytes _embeddedDAppData, + bytes memory _embeddedDAppData, bytes32 _witness, - bytes _rlpUnlockTxUnsigned, - bytes _proofBlob + bytes memory _rlpUnlockTxUnsigned, + bytes memory _proofBlob ) public { bytes32 commitBlockHash = blockhash(_commitTxBlockNumber); require( @@ -263,8 +263,8 @@ contract LibSubmarineSimple is ProvethVerifier { address submarine = ecrecover( unsignedUnlockTxHash, vee, - keccak256(abi.encodePacked(submarineId, byte(1))), - keccak256(abi.encodePacked(submarineId, byte(0))) + keccak256(abi.encodePacked(submarineId, byte(uint8(1)))), + keccak256(abi.encodePacked(submarineId, byte(uint8(0)))) ); require(provenCommitTx.to == submarine); diff --git a/contracts/LibSubmarineSimpleTestHelper.sol b/contracts/LibSubmarineSimpleTestHelper.sol index c411ef6..6d51ed5 100644 --- a/contracts/LibSubmarineSimpleTestHelper.sol +++ b/contracts/LibSubmarineSimpleTestHelper.sol @@ -1,13 +1,13 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "LibSubmarineSimple.sol"; contract LibSubmarineSimpleTestHelper is LibSubmarineSimple { function onSubmarineReveal( bytes32 _submarineId, - bytes _embeddedDAppData, + bytes memory _embeddedDAppData, uint256 _value ) internal { } -} \ No newline at end of file +} diff --git a/contracts/examples/erc721_auction/ERC721Auction.sol b/contracts/examples/erc721_auction/ERC721Auction.sol index 5e390a4..78a7133 100644 --- a/contracts/examples/erc721_auction/ERC721Auction.sol +++ b/contracts/examples/erc721_auction/ERC721Auction.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "../../openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; import "../../openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol"; diff --git a/contracts/examples/erc721_auction/ERC721AuctionSubmarine.sol b/contracts/examples/erc721_auction/ERC721AuctionSubmarine.sol index d1c926a..ea072a3 100644 --- a/contracts/examples/erc721_auction/ERC721AuctionSubmarine.sol +++ b/contracts/examples/erc721_auction/ERC721AuctionSubmarine.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ^0.5.0; import "LibSubmarineSimple.sol"; import "../../openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; diff --git a/contracts/examples/exchange/ERC20Interface.sol b/contracts/examples/exchange/ERC20Interface.sol index 0b54ad3..bdb9d55 100644 --- a/contracts/examples/exchange/ERC20Interface.sol +++ b/contracts/examples/exchange/ERC20Interface.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; contract ERC20Interface { @@ -10,4 +10,4 @@ contract ERC20Interface { function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); -} \ No newline at end of file +} diff --git a/contracts/examples/exchange/Exchange.sol b/contracts/examples/exchange/Exchange.sol index 44f9995..86166d6 100644 --- a/contracts/examples/exchange/Exchange.sol +++ b/contracts/examples/exchange/Exchange.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "../../LibSubmarineSimple.sol"; import "../../openzeppelin-solidity/contracts/math/SafeMath.sol"; diff --git a/contracts/examples/exchange/TestToken.sol b/contracts/examples/exchange/TestToken.sol index a9a8425..d8671ef 100644 --- a/contracts/examples/exchange/TestToken.sol +++ b/contracts/examples/exchange/TestToken.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "../../openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./ERC20Interface.sol"; diff --git a/contracts/openzeppelin-solidity b/contracts/openzeppelin-solidity index 80458eb..be4b80a 160000 --- a/contracts/openzeppelin-solidity +++ b/contracts/openzeppelin-solidity @@ -1 +1 @@ -Subproject commit 80458ebc72f1c7c9695416edbe26690f72e406a0 +Subproject commit be4b80a508781f90ccb7af0ac54fd6a1f64240e2 diff --git a/proveth b/proveth index a495a0e..c74b20e 160000 --- a/proveth +++ b/proveth @@ -1 +1 @@ -Subproject commit a495a0ea97a5e8483d0fc35a06133b6b6d55a431 +Subproject commit c74b20eac1f5f14a82ab1e8bb63fdd20a64309c5 diff --git a/test/test_LibSubmarineSimple.py b/test/test_LibSubmarineSimple.py index 247d760..6b6ef40 100644 --- a/test/test_LibSubmarineSimple.py +++ b/test/test_LibSubmarineSimple.py @@ -65,8 +65,8 @@ def setUp(self): 'proveth/ProvethVerifier.sol') ] }, - 'proveth/RLP.sol': { - 'urls': [os.path.join(contract_dir, 'proveth/RLP.sol')] + 'proveth/Solidity-RLP/contracts/RLPReader.sol': { + 'urls': [os.path.join(contract_dir, 'proveth/Solidity-RLP/contracts/RLPReader.sol')] } }, allow_paths=root_repo_dir,