Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
27653502
Commit
27653502
authored
Jul 31, 2018
by
Leo Arias
Committed by
Nicolás Venturo
Jul 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefix all parameters with underscore (#1133)
parent
1200969e
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
191 additions
and
191 deletions
+191
-191
AddressUtils.sol
contracts/AddressUtils.sol
+3
-3
Bounty.sol
contracts/Bounty.sol
+4
-4
ECRecovery.sol
contracts/ECRecovery.sol
+10
-10
SignatureBouncer.sol
contracts/access/SignatureBouncer.sol
+2
-2
Roles.sol
contracts/access/rbac/Roles.sol
+8
-8
RBACWithAdmin.sol
contracts/examples/RBACWithAdmin.sol
+8
-8
SimpleSavingsWallet.sol
contracts/examples/SimpleSavingsWallet.sol
+5
-5
TokenDestructible.sol
contracts/lifecycle/TokenDestructible.sol
+4
-4
Math.sol
contracts/math/Math.sol
+8
-8
SafeMath.sol
contracts/math/SafeMath.sol
+15
-15
BasicTokenMock.sol
contracts/mocks/BasicTokenMock.sol
+3
-3
BurnableTokenMock.sol
contracts/mocks/BurnableTokenMock.sol
+3
-3
ECRecoveryMock.sol
contracts/mocks/ECRecoveryMock.sol
+4
-4
ERC223TokenMock.sol
contracts/mocks/ERC223TokenMock.sol
+3
-3
MathMock.sol
contracts/mocks/MathMock.sol
+8
-8
MessageHelper.sol
contracts/mocks/MessageHelper.sol
+12
-12
PausableTokenMock.sol
contracts/mocks/PausableTokenMock.sol
+2
-2
PullPaymentMock.sol
contracts/mocks/PullPaymentMock.sol
+2
-2
ReentrancyAttack.sol
contracts/mocks/ReentrancyAttack.sol
+2
-2
ReentrancyMock.sol
contracts/mocks/ReentrancyMock.sol
+8
-8
SafeMathMock.sol
contracts/mocks/SafeMathMock.sol
+8
-8
StandardBurnableTokenMock.sol
contracts/mocks/StandardBurnableTokenMock.sol
+3
-3
StandardTokenMock.sol
contracts/mocks/StandardTokenMock.sol
+3
-3
CanReclaimToken.sol
contracts/ownership/CanReclaimToken.sol
+4
-4
Contactable.sol
contracts/ownership/Contactable.sol
+3
-3
HasNoContracts.sol
contracts/ownership/HasNoContracts.sol
+3
-3
HasNoTokens.sol
contracts/ownership/HasNoTokens.sol
+7
-7
Heritable.sol
contracts/ownership/Heritable.sol
+6
-6
ERC20.sol
contracts/token/ERC20/ERC20.sol
+3
-3
ERC20Basic.sol
contracts/token/ERC20/ERC20Basic.sol
+2
-2
RBACMintableToken.sol
contracts/token/ERC20/RBACMintableToken.sol
+6
-6
SafeERC20.sol
contracts/token/ERC20/SafeERC20.sol
+9
-9
TokenVesting.sol
contracts/token/ERC20/TokenVesting.sol
+20
-20
No files found.
contracts/AddressUtils.sol
View file @
27653502
...
...
@@ -10,10 +10,10 @@ library AddressUtils {
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @param
_
addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
function isContract(address
_
addr) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
...
...
@@ -22,7 +22,7 @@ library AddressUtils {
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solium-disable-next-line security/no-inline-assembly
assembly { size := extcodesize(addr) }
assembly { size := extcodesize(
_
addr) }
return size > 0;
}
...
...
contracts/Bounty.sol
View file @
27653502
...
...
@@ -36,13 +36,13 @@ contract Bounty is PullPayment, Destructible {
/**
* @dev Transfers the contract funds to the researcher that proved the contract is broken.
* @param target contract
* @param
_
target contract
*/
function claim(Target target) public {
address researcher = researchers[target];
function claim(Target
_
target) public {
address researcher = researchers[
_
target];
require(researcher != address(0));
// Check Target contract invariants
require(!target.checkInvariant());
require(!
_
target.checkInvariant());
asyncTransfer(researcher, address(this).balance);
claimed = true;
}
...
...
contracts/ECRecovery.sol
View file @
27653502
...
...
@@ -12,10 +12,10 @@ library ECRecovery {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
* @param
_
hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param
_
sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32
hash, bytes
sig)
function recover(bytes32
_hash, bytes _
sig)
internal
pure
returns (address)
...
...
@@ -25,7 +25,7 @@ library ECRecovery {
uint8 v;
// Check the signature length
if (sig.length != 65) {
if (
_
sig.length != 65) {
return (address(0));
}
...
...
@@ -34,9 +34,9 @@ library ECRecovery {
// currently is to use assembly.
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
r := mload(add(
_
sig, 32))
s := mload(add(
_
sig, 64))
v := byte(0, mload(add(
_
sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
...
...
@@ -49,7 +49,7 @@ library ECRecovery {
return (address(0));
} else {
// solium-disable-next-line arg-overflow
return ecrecover(hash, v, r, s);
return ecrecover(
_
hash, v, r, s);
}
}
...
...
@@ -58,7 +58,7 @@ library ECRecovery {
* @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
* and hash the result
*/
function toEthSignedMessageHash(bytes32 hash)
function toEthSignedMessageHash(bytes32
_
hash)
internal
pure
returns (bytes32)
...
...
@@ -66,7 +66,7 @@ library ECRecovery {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
abi.encodePacked("\x19Ethereum Signed Message:\n32",
_
hash)
);
}
}
contracts/access/SignatureBouncer.sol
View file @
27653502
...
...
@@ -146,12 +146,12 @@ contract SignatureBouncer is Ownable, RBAC {
* and then recover the signature and check it against the bouncer role
* @return bool
*/
function isValidDataHash(bytes32 hash, bytes _sig)
function isValidDataHash(bytes32
_
hash, bytes _sig)
internal
view
returns (bool)
{
address signer = hash
address signer =
_
hash
.toEthSignedMessageHash()
.recover(_sig);
return hasRole(signer, ROLE_BOUNCER);
...
...
contracts/access/rbac/Roles.sol
View file @
27653502
...
...
@@ -15,41 +15,41 @@ library Roles {
/**
* @dev give an address access to this role
*/
function add(Role storage
role, address
addr)
function add(Role storage
_role, address _
addr)
internal
{
role.bearer[
addr] = true;
_role.bearer[_
addr] = true;
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage
role, address
addr)
function remove(Role storage
_role, address _
addr)
internal
{
role.bearer[
addr] = false;
_role.bearer[_
addr] = false;
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage
role, address
addr)
function check(Role storage
_role, address _
addr)
view
internal
{
require(has(
role,
addr));
require(has(
_role, _
addr));
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage
role, address
addr)
function has(Role storage
_role, address _
addr)
view
internal
returns (bool)
{
return
role.bearer[
addr];
return
_role.bearer[_
addr];
}
}
contracts/examples/RBACWithAdmin.sol
View file @
27653502
...
...
@@ -42,25 +42,25 @@ contract RBACWithAdmin is RBAC {
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
* @param
_
addr address
* @param
_
roleName the name of the role
*/
function adminAddRole(address
addr, string
roleName)
function adminAddRole(address
_addr, string _
roleName)
onlyAdmin
public
{
addRole(
addr,
roleName);
addRole(
_addr, _
roleName);
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
* @param
_
addr address
* @param
_
roleName the name of the role
*/
function adminRemoveRole(address
addr, string
roleName)
function adminRemoveRole(address
_addr, string _
roleName)
onlyAdmin
public
{
removeRole(
addr,
roleName);
removeRole(
_addr, _
roleName);
}
}
contracts/examples/SimpleSavingsWallet.sol
View file @
27653502
...
...
@@ -31,10 +31,10 @@ contract SimpleSavingsWallet is Heritable {
/**
* @dev wallet can send funds
*/
function sendTo(address
payee, uint256
amount) public onlyOwner {
require(
payee != address(0) &&
payee != address(this));
require(amount > 0);
payee.transfer(
amount);
emit Sent(
payee,
amount, address(this).balance);
function sendTo(address
_payee, uint256 _
amount) public onlyOwner {
require(
_payee != address(0) && _
payee != address(this));
require(
_
amount > 0);
_payee.transfer(_
amount);
emit Sent(
_payee, _
amount, address(this).balance);
}
}
contracts/lifecycle/TokenDestructible.sol
View file @
27653502
...
...
@@ -16,16 +16,16 @@ contract TokenDestructible is Ownable {
/**
* @notice Terminate contract and refund to owner
* @param tokens List of addresses of ERC20 or ERC20Basic token contracts to
* @param
_
tokens List of addresses of ERC20 or ERC20Basic token contracts to
refund.
* @notice The called token contracts could try to re-enter this contract. Only
supply token contracts you trust.
*/
function destroy(address[] tokens) onlyOwner public {
function destroy(address[]
_
tokens) onlyOwner public {
// Transfer tokens to owner
for (uint256 i = 0; i < tokens.length; i++) {
ERC20Basic token = ERC20Basic(tokens[i]);
for (uint256 i = 0; i <
_
tokens.length; i++) {
ERC20Basic token = ERC20Basic(
_
tokens[i]);
uint256 balance = token.balanceOf(this);
token.transfer(owner, balance);
}
...
...
contracts/math/Math.sol
View file @
27653502
...
...
@@ -6,19 +6,19 @@ pragma solidity ^0.4.24;
* @dev Assorted math operations
*/
library Math {
function max64(uint64
a, uint64
b) internal pure returns (uint64) {
return
a >= b ? a :
b;
function max64(uint64
_a, uint64 _
b) internal pure returns (uint64) {
return
_a >= _b ? _a : _
b;
}
function min64(uint64
a, uint64
b) internal pure returns (uint64) {
return
a < b ? a :
b;
function min64(uint64
_a, uint64 _
b) internal pure returns (uint64) {
return
_a < _b ? _a : _
b;
}
function max256(uint256
a, uint256
b) internal pure returns (uint256) {
return
a >= b ? a :
b;
function max256(uint256
_a, uint256 _
b) internal pure returns (uint256) {
return
_a >= _b ? _a : _
b;
}
function min256(uint256
a, uint256
b) internal pure returns (uint256) {
return
a < b ? a :
b;
function min256(uint256
_a, uint256 _
b) internal pure returns (uint256) {
return
_a < _b ? _a : _
b;
}
}
contracts/math/SafeMath.sol
View file @
27653502
...
...
@@ -10,43 +10,43 @@ library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256
a, uint256
b) internal pure returns (uint256 c) {
function mul(uint256
_a, uint256 _
b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting '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) {
if (
_
a == 0) {
return 0;
}
c =
a *
b;
assert(c /
a ==
b);
c =
_a * _
b;
assert(c /
_a == _
b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256
a, uint256
b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws 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
a /
b;
function div(uint256
_a, uint256 _
b) internal pure returns (uint256) {
// assert(
_
b > 0); // Solidity automatically throws 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
_a / _
b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256
a, uint256
b) internal pure returns (uint256) {
assert(
b <=
a);
return
a -
b;
function sub(uint256
_a, uint256 _
b) internal pure returns (uint256) {
assert(
_b <= _
a);
return
_a - _
b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256
a, uint256
b) internal pure returns (uint256 c) {
c =
a +
b;
assert(c >= a);
function add(uint256
_a, uint256 _
b) internal pure returns (uint256 c) {
c =
_a + _
b;
assert(c >=
_
a);
return c;
}
}
contracts/mocks/BasicTokenMock.sol
View file @
27653502
...
...
@@ -7,9 +7,9 @@ import "../token/ERC20/BasicToken.sol";
// mock class using BasicToken
contract BasicTokenMock is BasicToken {
constructor(address
initialAccount, uint256
initialBalance) public {
balances[
initialAccount] =
initialBalance;
totalSupply_ = initialBalance;
constructor(address
_initialAccount, uint256 _
initialBalance) public {
balances[
_initialAccount] = _
initialBalance;
totalSupply_ =
_
initialBalance;
}
}
contracts/mocks/BurnableTokenMock.sol
View file @
27653502
...
...
@@ -5,9 +5,9 @@ import "../token/ERC20/BurnableToken.sol";
contract BurnableTokenMock is BurnableToken {
constructor(address
initialAccount, uint
initialBalance) public {
balances[
initialAccount] =
initialBalance;
totalSupply_ = initialBalance;
constructor(address
_initialAccount, uint _
initialBalance) public {
balances[
_initialAccount] = _
initialBalance;
totalSupply_ =
_
initialBalance;
}
}
contracts/mocks/ECRecoveryMock.sol
View file @
27653502
...
...
@@ -7,19 +7,19 @@ import "../ECRecovery.sol";
contract ECRecoveryMock {
using ECRecovery for bytes32;
function recover(bytes32
hash, bytes
sig)
function recover(bytes32
_hash, bytes _
sig)
public
pure
returns (address)
{
return
hash.recover(
sig);
return
_hash.recover(_
sig);
}
function toEthSignedMessageHash(bytes32 hash)
function toEthSignedMessageHash(bytes32
_
hash)
public
pure
returns (bytes32)
{
return hash.toEthSignedMessageHash();
return
_
hash.toEthSignedMessageHash();
}
}
contracts/mocks/ERC223TokenMock.sol
View file @
27653502
...
...
@@ -10,9 +10,9 @@ contract ERC223ContractInterface {
contract ERC223TokenMock is BasicToken {
constructor(address
initialAccount, uint256
initialBalance) public {
balances[
initialAccount] =
initialBalance;
totalSupply_ = initialBalance;
constructor(address
_initialAccount, uint256 _
initialBalance) public {
balances[
_initialAccount] = _
initialBalance;
totalSupply_ =
_
initialBalance;
}
// ERC223 compatible transfer function (except the name)
...
...
contracts/mocks/MathMock.sol
View file @
27653502
...
...
@@ -8,19 +8,19 @@ contract MathMock {
uint64 public result64;
uint256 public result256;
function max64(uint64
a, uint64
b) public {
result64 = Math.max64(
a,
b);
function max64(uint64
_a, uint64 _
b) public {
result64 = Math.max64(
_a, _
b);
}
function min64(uint64
a, uint64
b) public {
result64 = Math.min64(
a,
b);
function min64(uint64
_a, uint64 _
b) public {
result64 = Math.min64(
_a, _
b);
}
function max256(uint256
a, uint256
b) public {
result256 = Math.max256(
a,
b);
function max256(uint256
_a, uint256 _
b) public {
result256 = Math.max256(
_a, _
b);
}
function min256(uint256
a, uint256
b) public {
result256 = Math.min256(
a,
b);
function min256(uint256
_a, uint256 _
b) public {
result256 = Math.min256(
_a, _
b);
}
}
contracts/mocks/MessageHelper.sol
View file @
27653502
...
...
@@ -7,30 +7,30 @@ contract MessageHelper {
event Buy(bytes32 b32, uint256 number, string text, uint256 value);
function showMessage(
bytes32 message,
uint256 number,
string text
bytes32
_
message,
uint256
_
number,
string
_
text
)
public
returns (bool)
{
emit Show(
message, number,
text);
emit Show(
_message, _number, _
text);
return true;
}
function buyMessage(
bytes32 message,
uint256 number,
string text
bytes32
_
message,
uint256
_
number,
string
_
text
)
public
payable
returns (bool)
{
emit Buy(
message,
number,
text,
_
message,
_
number,
_
text,
msg.value);
return true;
}
...
...
@@ -39,9 +39,9 @@ contract MessageHelper {
require(false);
}
function call(address
to, bytes
data) public returns (bool) {
function call(address
_to, bytes _
data) public returns (bool) {
// solium-disable-next-line security/no-low-level-calls
if (
to.call(
data))
if (
_to.call(_
data))
return true;
else
return false;
...
...
contracts/mocks/PausableTokenMock.sol
View file @
27653502
...
...
@@ -6,8 +6,8 @@ import "../token/ERC20/PausableToken.sol";
// mock class using PausableToken
contract PausableTokenMock is PausableToken {
constructor(address
initialAccount, uint
initialBalance) public {
balances[
initialAccount] =
initialBalance;
constructor(address
_initialAccount, uint _
initialBalance) public {
balances[
_initialAccount] = _
initialBalance;
}
}
contracts/mocks/PullPaymentMock.sol
View file @
27653502
...
...
@@ -10,8 +10,8 @@ contract PullPaymentMock is PullPayment {
constructor() public payable { }
// test helper function to call asyncTransfer
function callTransfer(address
dest, uint256
amount) public {
asyncTransfer(
dest,
amount);
function callTransfer(address
_dest, uint256 _
amount) public {
asyncTransfer(
_dest, _
amount);
}
}
contracts/mocks/ReentrancyAttack.sol
View file @
27653502
...
...
@@ -3,9 +3,9 @@ pragma solidity ^0.4.24;
contract ReentrancyAttack {
function callSender(bytes4 data) public {
function callSender(bytes4
_
data) public {
// solium-disable-next-line security/no-low-level-calls
require(msg.sender.call(abi.encodeWithSelector(data)));
require(msg.sender.call(abi.encodeWithSelector(
_
data)));
}
}
contracts/mocks/ReentrancyMock.sol
View file @
27653502
...
...
@@ -16,26 +16,26 @@ contract ReentrancyMock is ReentrancyGuard {
count();
}
function countLocalRecursive(uint256 n) public nonReentrant {
if (n > 0) {
function countLocalRecursive(uint256
_
n) public nonReentrant {
if (
_
n > 0) {
count();
countLocalRecursive(n - 1);
countLocalRecursive(
_
n - 1);
}
}
function countThisRecursive(uint256 n) public nonReentrant {
if (n > 0) {
function countThisRecursive(uint256
_
n) public nonReentrant {
if (
_
n > 0) {
count();
// solium-disable-next-line security/no-low-level-calls
bool result = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1));
bool result = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)",
_
n - 1));
require(result == true);
}
}
function countAndCall(ReentrancyAttack attacker) public nonReentrant {
function countAndCall(ReentrancyAttack
_
attacker) public nonReentrant {
count();
bytes4 func = bytes4(keccak256("callback()"));
attacker.callSender(func);
_
attacker.callSender(func);
}
function count() private {
...
...
contracts/mocks/SafeMathMock.sol
View file @
27653502
...
...
@@ -6,19 +6,19 @@ import "../math/SafeMath.sol";
contract SafeMathMock {
function mul(uint256
a, uint256
b) public pure returns (uint256) {
return SafeMath.mul(
a,
b);
function mul(uint256
_a, uint256 _
b) public pure returns (uint256) {
return SafeMath.mul(
_a, _
b);
}
function div(uint256
a, uint256
b) public pure returns (uint256) {
return SafeMath.div(
a,
b);
function div(uint256
_a, uint256 _
b) public pure returns (uint256) {
return SafeMath.div(
_a, _
b);
}
function sub(uint256
a, uint256
b) public pure returns (uint256) {
return SafeMath.sub(
a,
b);
function sub(uint256
_a, uint256 _
b) public pure returns (uint256) {
return SafeMath.sub(
_a, _
b);
}
function add(uint256
a, uint256
b) public pure returns (uint256) {
return SafeMath.add(
a,
b);
function add(uint256
_a, uint256 _
b) public pure returns (uint256) {
return SafeMath.add(
_a, _
b);
}
}
contracts/mocks/StandardBurnableTokenMock.sol
View file @
27653502
...
...
@@ -5,9 +5,9 @@ import "../token/ERC20/StandardBurnableToken.sol";
contract StandardBurnableTokenMock is StandardBurnableToken {
constructor(address
initialAccount, uint
initialBalance) public {
balances[
initialAccount] =
initialBalance;
totalSupply_ = initialBalance;
constructor(address
_initialAccount, uint _
initialBalance) public {
balances[
_initialAccount] = _
initialBalance;
totalSupply_ =
_
initialBalance;
}
}
contracts/mocks/StandardTokenMock.sol
View file @
27653502
...
...
@@ -6,9 +6,9 @@ import "../token/ERC20/StandardToken.sol";
// mock class using StandardToken
contract StandardTokenMock is StandardToken {
constructor(address
initialAccount, uint256
initialBalance) public {
balances[
initialAccount] =
initialBalance;
totalSupply_ = initialBalance;
constructor(address
_initialAccount, uint256 _
initialBalance) public {
balances[
_initialAccount] = _
initialBalance;
totalSupply_ =
_
initialBalance;
}
}
contracts/ownership/CanReclaimToken.sol
View file @
27653502
...
...
@@ -16,11 +16,11 @@ contract CanReclaimToken is Ownable {
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
* @param
_
token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
function reclaimToken(ERC20Basic
_
token) external onlyOwner {
uint256 balance =
_
token.balanceOf(this);
_
token.safeTransfer(owner, balance);
}
}
contracts/ownership/Contactable.sol
View file @
27653502
...
...
@@ -14,9 +14,9 @@ contract Contactable is Ownable {
/**
* @dev Allows the owner to set a string with their contact information.
* @param info The contact information to attach to the contract.
* @param
_
info The contact information to attach to the contract.
*/
function setContactInformation(string info) onlyOwner public {
contactInformation = info;
function setContactInformation(string
_
info) onlyOwner public {
contactInformation =
_
info;
}
}
contracts/ownership/HasNoContracts.sol
View file @
27653502
...
...
@@ -13,10 +13,10 @@ contract HasNoContracts is Ownable {
/**
* @dev Reclaim ownership of Ownable contracts
* @param contractAddr The address of the Ownable to be reclaimed.
* @param
_
contractAddr The address of the Ownable to be reclaimed.
*/
function reclaimContract(address contractAddr) external onlyOwner {
Ownable contractInst = Ownable(contractAddr);
function reclaimContract(address
_
contractAddr) external onlyOwner {
Ownable contractInst = Ownable(
_
contractAddr);
contractInst.transferOwnership(owner);
}
}
contracts/ownership/HasNoTokens.sol
View file @
27653502
...
...
@@ -14,14 +14,14 @@ contract HasNoTokens is CanReclaimToken {
/**
* @dev Reject all ERC223 compatible tokens
* @param
from_
address The address that is transferring the tokens
* @param
value_
uint256 the amount of the specified token
* @param
data_
Bytes The data passed from the caller.
* @param
_from
address The address that is transferring the tokens
* @param
_value
uint256 the amount of the specified token
* @param
_data
Bytes The data passed from the caller.
*/
function tokenFallback(address
from_, uint256 value_, bytes data_
) external pure {
from_
;
value_
;
data_
;
function tokenFallback(address
_from, uint256 _value, bytes _data
) external pure {
_from
;
_value
;
_data
;
revert();
}
...
...
contracts/ownership/Heritable.sol
View file @
27653502
...
...
@@ -50,11 +50,11 @@ contract Heritable is Ownable {
setHeartbeatTimeout(_heartbeatTimeout);
}
function setHeir(address newHeir) public onlyOwner {
require(newHeir != owner);
function setHeir(address
_
newHeir) public onlyOwner {
require(
_
newHeir != owner);
heartbeat();
emit HeirChanged(owner, newHeir);
heir_ = newHeir;
emit HeirChanged(owner,
_
newHeir);
heir_ =
_
newHeir;
}
/**
...
...
@@ -113,11 +113,11 @@ contract Heritable is Ownable {
timeOfDeath_ = 0;
}
function setHeartbeatTimeout(uint256 newHeartbeatTimeout)
function setHeartbeatTimeout(uint256
_
newHeartbeatTimeout)
internal onlyOwner
{
require(ownerLives());
heartbeatTimeout_ = newHeartbeatTimeout;
heartbeatTimeout_ =
_
newHeartbeatTimeout;
}
function ownerLives() internal view returns (bool) {
...
...
contracts/token/ERC20/ERC20.sol
View file @
27653502
...
...
@@ -8,13 +8,13 @@ import "./ERC20Basic.sol";
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address
owner, address
spender)
function allowance(address
_owner, address _
spender)
public view returns (uint256);
function transferFrom(address
from, address to, uint256
value)
function transferFrom(address
_from, address _to, uint256 _
value)
public returns (bool);
function approve(address
spender, uint256
value) public returns (bool);
function approve(address
_spender, uint256 _
value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
...
...
contracts/token/ERC20/ERC20Basic.sol
View file @
27653502
...
...
@@ -8,7 +8,7 @@ pragma solidity ^0.4.24;
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address
to, uint256
value) public returns (bool);
function balanceOf(address
_
who) public view returns (uint256);
function transfer(address
_to, uint256 _
value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contracts/token/ERC20/RBACMintableToken.sol
View file @
27653502
...
...
@@ -25,17 +25,17 @@ contract RBACMintableToken is MintableToken, RBAC {
/**
* @dev add a minter role to an address
* @param minter address
* @param
_
minter address
*/
function addMinter(address minter) onlyOwner public {
addRole(minter, ROLE_MINTER);
function addMinter(address
_
minter) onlyOwner public {
addRole(
_
minter, ROLE_MINTER);
}
/**
* @dev remove a minter role from an address
* @param minter address
* @param
_
minter address
*/
function removeMinter(address minter) onlyOwner public {
removeRole(minter, ROLE_MINTER);
function removeMinter(address
_
minter) onlyOwner public {
removeRole(
_
minter, ROLE_MINTER);
}
}
contracts/token/ERC20/SafeERC20.sol
View file @
27653502
...
...
@@ -11,22 +11,22 @@ import "./ERC20.sol";
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic
token, address to, uint256
value) internal {
require(
token.transfer(to,
value));
function safeTransfer(ERC20Basic
_token, address _to, uint256 _
value) internal {
require(
_token.transfer(_to, _
value));
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
ERC20
_
token,
address
_
from,
address
_
to,
uint256
_
value
)
internal
{
require(
token.transferFrom(from, to,
value));
require(
_token.transferFrom(_from, _to, _
value));
}
function safeApprove(ERC20
token, address spender, uint256
value) internal {
require(
token.approve(spender,
value));
function safeApprove(ERC20
_token, address _spender, uint256 _
value) internal {
require(
_token.approve(_spender, _
value));
}
}
contracts/token/ERC20/TokenVesting.sol
View file @
27653502
...
...
@@ -64,16 +64,16 @@ contract TokenVesting is Ownable {
/**
* @notice Transfers vested tokens to beneficiary.
* @param token ERC20 token which is being vested
* @param
_
token ERC20 token which is being vested
*/
function release(ERC20Basic token) public {
uint256 unreleased = releasableAmount(token);
function release(ERC20Basic
_
token) public {
uint256 unreleased = releasableAmount(
_
token);
require(unreleased > 0);
released[
token] = released[
token].add(unreleased);
released[
_token] = released[_
token].add(unreleased);
token.safeTransfer(beneficiary, unreleased);
_
token.safeTransfer(beneficiary, unreleased);
emit Released(unreleased);
}
...
...
@@ -81,43 +81,43 @@ contract TokenVesting is Ownable {
/**
* @notice Allows the owner to revoke the vesting. Tokens already vested
* remain in the contract, the rest are returned to the owner.
* @param token ERC20 token which is being vested
* @param
_
token ERC20 token which is being vested
*/
function revoke(ERC20Basic token) public onlyOwner {
function revoke(ERC20Basic
_
token) public onlyOwner {
require(revocable);
require(!revoked[token]);
require(!revoked[
_
token]);
uint256 balance = token.balanceOf(this);
uint256 balance =
_
token.balanceOf(this);
uint256 unreleased = releasableAmount(token);
uint256 unreleased = releasableAmount(
_
token);
uint256 refund = balance.sub(unreleased);
revoked[token] = true;
revoked[
_
token] = true;
token.safeTransfer(owner, refund);
_
token.safeTransfer(owner, refund);
emit Revoked();
}
/**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param token ERC20 token which is being vested
* @param
_
token ERC20 token which is being vested
*/
function releasableAmount(ERC20Basic token) public view returns (uint256) {
return vestedAmount(
token).sub(released[
token]);
function releasableAmount(ERC20Basic
_
token) public view returns (uint256) {
return vestedAmount(
_token).sub(released[_
token]);
}
/**
* @dev Calculates the amount that has already vested.
* @param token ERC20 token which is being vested
* @param
_
token ERC20 token which is being vested
*/
function vestedAmount(ERC20Basic token) public view returns (uint256) {
uint256 currentBalance = token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released[token]);
function vestedAmount(ERC20Basic
_
token) public view returns (uint256) {
uint256 currentBalance =
_
token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released[
_
token]);
if (block.timestamp < cliff) {
return 0;
} else if (block.timestamp >= start.add(duration) || revoked[token]) {
} else if (block.timestamp >= start.add(duration) || revoked[
_
token]) {
return totalBalance;
} else {
return totalBalance.mul(block.timestamp.sub(start)).div(duration);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment