-
Notifications
You must be signed in to change notification settings - Fork 916
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
Optimize Personal Edition #25
Merged
Merged
Changes from 13 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
c12c720
Improve and cleanup Gnosis Safe
rmeissner b14eb2c
Implement #15: Add version byte for hashing
rmeissner cd5f25c
Implement #13: EIP-897 interface on Proxy
rmeissner e72143b
Adjusted extension logic
rmeissner 4d7342d
Fixed tests
rmeissner e7ca1b2
Implemented #14: Use signature with daily limit extension
rmeissner 37d6a41
Implements #20: Optimize array access in setup functions
rmeissner 60facf3
Added different payment options (#26)
rmeissner ce6acef
Use gas instead of not(0)
rmeissner 1ffee77
replace assembly switch with if
rmeissner 2b95bc5
Added test for different safe versions
rmeissner 1a750ec
Added test for send exploit
rmeissner af6a41b
Use preset gasPrice, Use transfer instead of send
rmeissner cf3098e
Implemented PR comments
rmeissner 910f6dd
Fix tests
rmeissner 5281a66
Use correct names for tests
rmeissner 2bcbf07
Implement linked lists for modulemanager and ownermanager
rmeissner e5f2fe3
Optimize gas usage
rmeissner 0aadbb0
Add note for naming of execute functions
rmeissner 43adf2b
Optimized method names
rmeissner 392634d
Convert state channel edition to state channel module
rmeissner f3c1d3f
Use CreateAndAddModules everywhere
rmeissner 5ac5aed
Use parameters to approce transaction in team edition
rmeissner 2a8268a
Fail if module execution fails
rmeissner 580e3cf
Add require to module manager setup
rmeissner 9e022c4
Fix calculation of padding in assembly; Remove unused contracts
rmeissner 34323d6
Use revert to prevent requiredTxGas from being called in transaction
rmeissner f340b5d
Update readme; comment out revert in requiredTxGas function
rmeissner 72c86bb
Add possibility to pay with token
rmeissner f06a766
Downgrade solidity pragma for truffle
rmeissner e3a4e0e
fix test
rmeissner 22b5f85
Fix create and add modules test
rmeissner 73e5061
More test fixing
rmeissner 917625d
It is late
rmeissner c647011
enable revert
rmeissner fa626f3
Adjust dependencies
rmeissner 06703b1
Add possibility to pay safe creation with tokens
rmeissner 0f2453e
Calculate method ids at compile time
rmeissner 71f7559
Fix warnings
rmeissner 92d1214
Use build in solidity abi methods
rmeissner d84819b
Audit improvements for team edition
rmeissner 4d616d0
Require token transfer for payment to be successfull
rmeissner 4ed1ece
Added test for auto confirm of sender
rmeissner be2c138
Added error message to all requires
rmeissner 95ccf95
Adjusted revert messages
rmeissner b24f6fc
More error message adjustments
rmeissner b42b5f9
Add mnemonic logic for deployment
rmeissner 76b70e8
Fix truffle dependency
rmeissner b22967a
Fix possibility of malicious replace/remove operations on owners and …
rmeissner 0ef7ade
Added delegatecall for multi send
rmeissner 51a0935
Add hash to failed event; Use ganache npm package
rmeissner ecf060b
Update package-lock
rmeissner 4567ea1
Added error message for ether payment; Removed static costs and inclu…
rmeissner 355c413
Change bool and uint8 to uint256
rmeissner 942968d
Change r, s, v arrays to bytes
rmeissner 2983553
Use uint256 instead of uint8
rmeissner 9dd2a84
Adjust visibility of signature validation methods
rmeissner 04d2785
Perform token transfer in assembly for correct return
rmeissner 1007cd9
Remove naming check for team edition
rmeissner cb41a12
Remove unused erc20 interface
rmeissner 7aec3c0
Delete .node-xmlhttprequest-sync-11990
rmeissner 5a7a442
Add tests for failed payment of creation
rmeissner 73acdc6
Fix safe creation payment
rmeissner 898cc89
Added require messages for paying proxy
rmeissner 68685cd
Added audit report
rmeissner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- '9' | ||
before_script: | ||
- 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
pragma solidity 0.4.23; | ||
|
||
|
||
/// @title Delegate Constructor Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. It is possible to send along initialization data with the constructor. | ||
/// @author Stefan George - <stefan@gnosis.pm> | ||
/// @author Richard Meissner - <richard@gnosis.pm> | ||
contract DelegateConstructorProxy { | ||
|
||
// masterCopy always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated. | ||
address masterCopy; | ||
|
||
/// @dev Constructor function sets address of master copy contract. | ||
/// @param _masterCopy Master copy address. | ||
/// @param initializer Data used for a delegate call to initialize the contract. | ||
constructor(address _masterCopy, bytes initializer) | ||
public | ||
{ | ||
require(_masterCopy != 0); | ||
masterCopy = _masterCopy; | ||
if (initializer.length > 0) { | ||
delegate(initializer, false); | ||
} | ||
} | ||
|
||
/// @dev Fallback function forwards all transactions and returns all received return data. | ||
function () | ||
external | ||
payable | ||
{ | ||
delegate(msg.data, true); | ||
} | ||
|
||
function delegate(bytes _calldata, bool returnData) | ||
internal | ||
{ | ||
// solium-disable-next-line security/no-inline-assembly | ||
assembly { | ||
let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff) | ||
let success := delegatecall(sub(gas, 10000), masterCopy, add(_calldata, 0x20), mload(_calldata), 0, 0) | ||
let ptr := mload(0x40) | ||
returndatacopy(ptr, 0, returndatasize) | ||
if eq(success, 0) { revert(ptr, returndatasize) } | ||
if returnData { return(ptr, returndatasize) } | ||
} | ||
} | ||
|
||
function implementation() | ||
public | ||
view | ||
returns (address) | ||
{ | ||
return masterCopy; | ||
} | ||
|
||
function proxyType() | ||
public | ||
pure | ||
returns (uint256) | ||
{ | ||
return 2; | ||
} | ||
} |
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,12 @@ | ||
pragma solidity 0.4.23; | ||
|
||
|
||
/// @title Enum - Collection of enums | ||
/// @author Richard Meissner - <richard@gnosis.pm> | ||
contract Enum { | ||
enum Operation { | ||
Call, | ||
DelegateCall, | ||
Create | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not always retrunData == true? I would remove this argument as the constructor case a single time use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we copy the delegate call logic in the constructor the one time costs might increase not sure how much the per transaction gas increases because of that, will check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm gas costs are exactly the same :D