Skip to content

Commit

Permalink
Implement #13: EIP-897 interface on Proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
rmeissner committed Apr 16, 2018
1 parent b14eb2c commit cd5f25c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 29 deletions.
2 changes: 1 addition & 1 deletion contracts/GnosisSafe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract GnosisSafe {

// masterCopy always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.
// It should also always be ensured that the address is stored alone (uses a full word)
GnosisSafe public masterCopy;
GnosisSafe masterCopy;

uint256 public nonce;
uint8 public threshold;
Expand Down
18 changes: 17 additions & 1 deletion contracts/Proxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity 0.4.21;
contract Proxy {

// 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 public masterCopy;
address masterCopy;

/// @dev Constructor function sets address of master copy contract.
/// @param _masterCopy Master copy address.
Expand All @@ -32,4 +32,20 @@ contract Proxy {
default { return(0, returndatasize()) }
}
}

function implementation()
public
view
returns (address)
{
return masterCopy;
}

function proxyType()
public
pure
returns (uint256)
{
return 2;
}
}
10 changes: 0 additions & 10 deletions contracts/extensions/DailyLimitExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ contract DailyLimitExtension is Extension {
_;
}

/// @dev Constructor function triggers setup function.
/// @param tokens List of token addresses. Ether is represented with address 0x0.
/// @param _dailyLimits List of daily limits in smallest unit (e.g. Wei for Ether).
/// First entry of array corresponds to first entry in token address array.
function DailyLimitExtension(address[] tokens, uint256[] _dailyLimits)
public
{
setup(tokens, _dailyLimits);
}

/// @dev Setup function sets initial storage of contract.
/// @param tokens List of token addresses. Ether is represented with address 0x0.
/// @param _dailyLimits List of daily limits in smalles units (e.g. Wei for Ether).
Expand Down
9 changes: 0 additions & 9 deletions contracts/extensions/SocialRecoveryExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ contract SocialRecoveryExtension is Extension {
_;
}

/// @dev Constructor function triggers setup function.
/// @param _friends List of friends' addresses.
/// @param _threshold Required number of friends to confirm replacement.
function SocialRecoveryExtension(address[] _friends, uint8 _threshold)
public
{
setup(_friends, _threshold);
}

/// @dev Setup function sets initial storage of contract.
/// @param _friends List of friends' addresses.
/// @param _threshold Required number of friends to confirm replacement.
Expand Down
8 changes: 0 additions & 8 deletions contracts/extensions/WhitelistExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ contract WhitelistExtension is Extension {
_;
}

/// @dev Constructor function triggers setup function.
/// @param accounts List of whitelisted accounts.
function WhitelistExtension(address[] accounts)
public
{
setup(accounts);
}

/// @dev Setup function sets initial storage of contract.
/// @param accounts List of whitelisted accounts.
function setup(address[] accounts)
Expand Down

0 comments on commit cd5f25c

Please sign in to comment.