Skip to content

Commit ea8ce5f

Browse files
committed
Added explicit data locations for function parameters to comply with Solidity v050.
1 parent b59b43f commit ea8ce5f

29 files changed

+60
-60
lines changed

contracts/ECRecovery.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ library ECRecovery {
1515
* @param _hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
1616
* @param _signature bytes signature, the signature is generated using web3.eth.sign()
1717
*/
18-
function recover(bytes32 _hash, bytes _signature)
18+
function recover(bytes32 _hash, bytes memory _signature)
1919
internal
2020
pure
2121
returns (address)

contracts/MerkleProof.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ library MerkleProof {
1515
* @param _leaf Leaf of Merkle tree
1616
*/
1717
function verifyProof(
18-
bytes32[] _proof,
18+
bytes32[] memory _proof,
1919
bytes32 _root,
2020
bytes32 _leaf
2121
)

contracts/access/SignatureBouncer.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ contract SignatureBouncer is Ownable, RBAC {
4040
/**
4141
* @dev requires that a valid signature of a bouncer was provided
4242
*/
43-
modifier onlyValidSignature(bytes _signature)
43+
modifier onlyValidSignature(bytes memory _signature)
4444
{
4545
require(isValidSignature(msg.sender, _signature));
4646
_;
@@ -49,7 +49,7 @@ contract SignatureBouncer is Ownable, RBAC {
4949
/**
5050
* @dev requires that a valid signature with a specifed method of a bouncer was provided
5151
*/
52-
modifier onlyValidSignatureAndMethod(bytes _signature)
52+
modifier onlyValidSignatureAndMethod(bytes memory _signature)
5353
{
5454
require(isValidSignatureAndMethod(msg.sender, _signature));
5555
_;
@@ -58,7 +58,7 @@ contract SignatureBouncer is Ownable, RBAC {
5858
/**
5959
* @dev requires that a valid signature with a specifed method and params of a bouncer was provided
6060
*/
61-
modifier onlyValidSignatureAndData(bytes _signature)
61+
modifier onlyValidSignatureAndData(bytes memory _signature)
6262
{
6363
require(isValidSignatureAndData(msg.sender, _signature));
6464
_;
@@ -89,7 +89,7 @@ contract SignatureBouncer is Ownable, RBAC {
8989
* @dev is the signature of `this + sender` from a bouncer?
9090
* @return bool
9191
*/
92-
function isValidSignature(address _address, bytes _signature)
92+
function isValidSignature(address _address, bytes memory _signature)
9393
internal
9494
view
9595
returns (bool)
@@ -104,7 +104,7 @@ contract SignatureBouncer is Ownable, RBAC {
104104
* @dev is the signature of `this + sender + methodId` from a bouncer?
105105
* @return bool
106106
*/
107-
function isValidSignatureAndMethod(address _address, bytes _signature)
107+
function isValidSignatureAndMethod(address _address, bytes memory _signature)
108108
internal
109109
view
110110
returns (bool)
@@ -124,7 +124,7 @@ contract SignatureBouncer is Ownable, RBAC {
124124
* @notice the _signature parameter of the method being validated must be the "last" parameter
125125
* @return bool
126126
*/
127-
function isValidSignatureAndData(address _address, bytes _signature)
127+
function isValidSignatureAndData(address _address, bytes memory _signature)
128128
internal
129129
view
130130
returns (bool)
@@ -145,7 +145,7 @@ contract SignatureBouncer is Ownable, RBAC {
145145
* and then recover the signature and check it against the bouncer role
146146
* @return bool
147147
*/
148-
function isValidDataHash(bytes32 _hash, bytes _signature)
148+
function isValidDataHash(bytes32 _hash, bytes memory _signature)
149149
internal
150150
view
151151
returns (bool)

contracts/access/Whitelist.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ contract Whitelist is Ownable, RBAC {
5151
* @return true if at least one address was added to the whitelist,
5252
* false if all addresses were already in the whitelist
5353
*/
54-
function addAddressesToWhitelist(address[] _operators)
54+
function addAddressesToWhitelist(address[] memory _operators)
5555
public
5656
onlyOwner
5757
{
@@ -79,7 +79,7 @@ contract Whitelist is Ownable, RBAC {
7979
* @return true if at least one address was removed from the whitelist,
8080
* false if all addresses weren't in the whitelist in the first place
8181
*/
82-
function removeAddressesFromWhitelist(address[] _operators)
82+
function removeAddressesFromWhitelist(address[] memory _operators)
8383
public
8484
onlyOwner
8585
{

contracts/access/rbac/RBAC.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ contract RBAC {
2626
* @param _role the name of the role
2727
* // reverts
2828
*/
29-
function checkRole(address _operator, string _role)
29+
function checkRole(address _operator, string memory _role)
3030
public
3131
view
3232
{
@@ -39,7 +39,7 @@ contract RBAC {
3939
* @param _role the name of the role
4040
* @return bool
4141
*/
42-
function hasRole(address _operator, string _role)
42+
function hasRole(address _operator, string memory _role)
4343
public
4444
view
4545
returns (bool)
@@ -52,7 +52,7 @@ contract RBAC {
5252
* @param _operator address
5353
* @param _role the name of the role
5454
*/
55-
function addRole(address _operator, string _role)
55+
function addRole(address _operator, string memory _role)
5656
internal
5757
{
5858
roles[_role].add(_operator);
@@ -64,7 +64,7 @@ contract RBAC {
6464
* @param _operator address
6565
* @param _role the name of the role
6666
*/
67-
function removeRole(address _operator, string _role)
67+
function removeRole(address _operator, string memory _role)
6868
internal
6969
{
7070
roles[_role].remove(_operator);
@@ -76,7 +76,7 @@ contract RBAC {
7676
* @param _role the name of the role
7777
* // reverts
7878
*/
79-
modifier onlyRole(string _role)
79+
modifier onlyRole(string memory _role)
8080
{
8181
checkRole(msg.sender, _role);
8282
_;
@@ -90,7 +90,7 @@ contract RBAC {
9090
* @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
9191
* see: https://github.com/ethereum/solidity/issues/2467
9292
*/
93-
// modifier onlyRoles(string[] _roles) {
93+
// modifier onlyRoles(string[] memory _roles) {
9494
// bool hasAnyRole = false;
9595
// for (uint8 i = 0; i < _roles.length; i++) {
9696
// if (hasRole(msg.sender, _roles[i])) {

contracts/examples/RBACWithAdmin.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ contract RBACWithAdmin is RBAC {
4545
* @param _account the account that will have the role
4646
* @param _roleName the name of the role
4747
*/
48-
function adminAddRole(address _account, string _roleName)
48+
function adminAddRole(address _account, string memory _roleName)
4949
public
5050
onlyAdmin
5151
{

contracts/lifecycle/TokenDestructible.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ contract TokenDestructible is Ownable {
2121
* @notice The called token contracts could try to re-enter this contract. Only
2222
supply token contracts you trust.
2323
*/
24-
function destroy(address[] _tokens) public onlyOwner {
24+
function destroy(address[] memory _tokens) public onlyOwner {
2525

2626
// Transfer tokens to owner
2727
for (uint256 i = 0; i < _tokens.length; i++) {

contracts/mocks/BouncerMock.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ contract SignatureBouncerMock is SignatureBouncer {
1212
return isValidSignature(_address, _signature);
1313
}
1414

15-
function onlyWithValidSignature(bytes _signature)
15+
function onlyWithValidSignature(bytes memory _signature)
1616
public
1717
onlyValidSignature(_signature)
1818
view
1919
{
2020

2121
}
2222

23-
function checkValidSignatureAndMethod(address _address, bytes _signature)
23+
function checkValidSignatureAndMethod(address _address, bytes memory _signature)
2424
public
2525
view
2626
returns (bool)
2727
{
2828
return isValidSignatureAndMethod(_address, _signature);
2929
}
3030

31-
function onlyWithValidSignatureAndMethod(bytes _signature)
31+
function onlyWithValidSignatureAndMethod(bytes memory _signature)
3232
public
3333
onlyValidSignatureAndMethod(_signature)
3434
view
@@ -38,9 +38,9 @@ contract SignatureBouncerMock is SignatureBouncer {
3838

3939
function checkValidSignatureAndData(
4040
address _address,
41-
bytes,
41+
bytes memory,
4242
uint,
43-
bytes _signature
43+
bytes memory _signature
4444
)
4545
public
4646
view
@@ -49,7 +49,7 @@ contract SignatureBouncerMock is SignatureBouncer {
4949
return isValidSignatureAndData(_address, _signature);
5050
}
5151

52-
function onlyWithValidSignatureAndData(uint, bytes _signature)
52+
function onlyWithValidSignatureAndData(uint, bytes memory _signature)
5353
public
5454
onlyValidSignatureAndData(_signature)
5555
view

contracts/mocks/DetailedERC20Mock.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import "../token/ERC20/DetailedERC20.sol";
66

77
contract DetailedERC20Mock is StandardToken, DetailedERC20 {
88
constructor(
9-
string _name,
10-
string _symbol,
9+
string memory _name,
10+
string memory _symbol,
1111
uint8 _decimals
1212
)
1313
DetailedERC20(_name, _symbol, _decimals)

contracts/mocks/ECRecoveryMock.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "../ECRecovery.sol";
77
contract ECRecoveryMock {
88
using ECRecovery for bytes32;
99

10-
function recover(bytes32 _hash, bytes _signature)
10+
function recover(bytes32 _hash, bytes memory _signature)
1111
public
1212
pure
1313
returns (address)

0 commit comments

Comments
 (0)