-
Notifications
You must be signed in to change notification settings - Fork 964
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,889 additions
and
2,046 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ cache: | |
directories: | ||
- node_modules | ||
before_script: | ||
- cd node_modules/truffle && npm install [email protected] | ||
- truffle compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
import "./base/BaseSafe.sol"; | ||
import "./common/MasterCopy.sol"; | ||
import "./common/SignatureDecoder.sol"; | ||
import "./common/SecuredTokenTransfer.sol"; | ||
import "./interfaces/ISignatureValidator.sol"; | ||
import "openzeppelin-solidity/contracts/math/SafeMath.sol"; | ||
import "./external/SafeMath.sol"; | ||
|
||
/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191. | ||
/// @author Stefan George - <[email protected]> | ||
|
@@ -67,22 +67,15 @@ contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTrans | |
/// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin). | ||
/// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v}) | ||
function execTransaction( | ||
<<<<<<< HEAD | ||
address to, | ||
uint256 value, | ||
bytes data, | ||
bytes memory data, | ||
Enum.Operation operation, | ||
======= | ||
address to, | ||
uint256 value, | ||
bytes memory data, | ||
Enum.Operation operation, | ||
>>>>>>> dd768ad... Fix solidity 0.5.0 errors | ||
uint256 safeTxGas, | ||
uint256 dataGas, | ||
uint256 gasPrice, | ||
address gasToken, | ||
address refundReceiver, | ||
address payable refundReceiver, | ||
bytes memory signatures | ||
) | ||
public | ||
|
@@ -115,13 +108,13 @@ contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTrans | |
uint256 dataGas, | ||
uint256 gasPrice, | ||
address gasToken, | ||
address refundReceiver | ||
address payable refundReceiver | ||
) | ||
private | ||
{ | ||
uint256 amount = startGas.sub(gasleft()).add(dataGas).mul(gasPrice); | ||
// solium-disable-next-line security/no-tx-origin | ||
address receiver = refundReceiver == address(0) ? tx.origin : refundReceiver; | ||
address payable receiver = refundReceiver == address(0) ? tx.origin : refundReceiver; | ||
if (gasToken == address(0)) { | ||
// solium-disable-next-line security/no-send | ||
require(receiver.send(amount), "Could not pay gas costs with ether"); | ||
|
@@ -231,13 +224,8 @@ contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTrans | |
/** | ||
* @dev Marks a message as signed | ||
* @param _data Arbitrary length data that should be marked as signed on the behalf of address(this) | ||
<<<<<<< HEAD | ||
*/ | ||
function signMessage(bytes _data) | ||
======= | ||
*/ | ||
function signMessage(bytes memory _data) | ||
>>>>>>> dd768ad... Fix solidity 0.5.0 errors | ||
public | ||
authorized | ||
{ | ||
|
@@ -249,13 +237,8 @@ contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTrans | |
* @param _data Arbitrary length data signed on the behalf of address(this) | ||
* @param _signature Signature byte array associated with _data | ||
* @return a bool upon valid or invalid signature with corresponding _data | ||
<<<<<<< HEAD | ||
*/ | ||
function isValidSignature(bytes _data, bytes _signature) | ||
======= | ||
*/ | ||
function isValidSignature(bytes memory _data, bytes memory _signature) | ||
>>>>>>> dd768ad... Fix solidity 0.5.0 errors | ||
public | ||
returns (bool isValid) | ||
{ | ||
|
@@ -299,23 +282,13 @@ contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTrans | |
/// @param _nonce Transaction nonce. | ||
/// @return Transaction hash bytes. | ||
function encodeTransactionData( | ||
<<<<<<< HEAD | ||
address to, | ||
uint256 value, | ||
bytes data, | ||
Enum.Operation operation, | ||
uint256 safeTxGas, | ||
uint256 dataGas, | ||
uint256 gasPrice, | ||
======= | ||
address to, | ||
uint256 value, | ||
bytes memory data, | ||
Enum.Operation operation, | ||
uint256 safeTxGas, | ||
uint256 dataGas, | ||
uint256 gasPrice, | ||
>>>>>>> dd768ad... Fix solidity 0.5.0 errors | ||
uint256 gasPrice, | ||
address gasToken, | ||
address refundReceiver, | ||
uint256 _nonce | ||
|
@@ -343,23 +316,13 @@ contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTrans | |
/// @param _nonce Transaction nonce. | ||
/// @return Transaction hash. | ||
function getTransactionHash( | ||
<<<<<<< HEAD | ||
address to, | ||
uint256 value, | ||
bytes data, | ||
Enum.Operation operation, | ||
uint256 safeTxGas, | ||
uint256 dataGas, | ||
uint256 gasPrice, | ||
======= | ||
address to, | ||
uint256 value, | ||
bytes memory data, | ||
Enum.Operation operation, | ||
uint256 safeTxGas, | ||
uint256 dataGas, | ||
uint256 gasPrice, | ||
>>>>>>> dd768ad... Fix solidity 0.5.0 errors | ||
uint256 gasPrice, | ||
address gasToken, | ||
address refundReceiver, | ||
uint256 _nonce | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
|
||
/// @title Enum - Collection of enums | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
import "./SelfAuthorized.sol"; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
|
||
/// @title SecuredTokenTransfer - Secure token transfer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
/** | ||
* @title SafeMath | ||
* @dev Math operations with safety checks that revert on error | ||
* TODO: remove once open zeppelin update to solc 0.5.0 | ||
*/ | ||
library SafeMath { | ||
|
||
/** | ||
* @dev Multiplies two numbers, reverts on overflow. | ||
*/ | ||
function mul(uint256 a, uint256 b) internal pure returns (uint256) { | ||
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the | ||
// benefit is lost if 'b' is also tested. | ||
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 | ||
if (a == 0) { | ||
return 0; | ||
} | ||
|
||
uint256 c = a * b; | ||
require(c / a == b); | ||
|
||
return c; | ||
} | ||
|
||
/** | ||
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero. | ||
*/ | ||
function div(uint256 a, uint256 b) internal pure returns (uint256) { | ||
require(b > 0); // Solidity only automatically asserts when dividing by 0 | ||
uint256 c = a / b; | ||
// assert(a == b * c + a % b); // There is no case in which this doesn't hold | ||
|
||
return c; | ||
} | ||
|
||
/** | ||
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). | ||
*/ | ||
function sub(uint256 a, uint256 b) internal pure returns (uint256) { | ||
require(b <= a); | ||
uint256 c = a - b; | ||
|
||
return c; | ||
} | ||
|
||
/** | ||
* @dev Adds two numbers, reverts on overflow. | ||
*/ | ||
function add(uint256 a, uint256 b) internal pure returns (uint256) { | ||
uint256 c = a + b; | ||
require(c >= a); | ||
|
||
return c; | ||
} | ||
|
||
/** | ||
* @dev Divides two numbers and returns the remainder (unsigned integer modulo), | ||
* reverts when dividing by zero. | ||
*/ | ||
function mod(uint256 a, uint256 b) internal pure returns (uint256) { | ||
require(b != 0); | ||
return a % b; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
contract ISignatureValidator { | ||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
import "../base/Module.sol"; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
import "./Proxy.sol"; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
import "./Proxy.sol"; | ||
|
||
|
||
|
Oops, something went wrong.