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
b395b06b
Commit
b395b06b
authored
Sep 18, 2017
by
dmx374
Committed by
Francisco Giordano
Sep 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicit public visibility on methods
parent
bd84db73
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
52 additions
and
52 deletions
+52
-52
Bounty.sol
contracts/Bounty.sol
+3
-3
ECRecovery.sol
contracts/ECRecovery.sol
+1
-1
Crowdsale.sol
contracts/crowdsale/Crowdsale.sol
+1
-1
FinalizableCrowdsale.sol
contracts/crowdsale/FinalizableCrowdsale.sol
+1
-1
RefundVault.sol
contracts/crowdsale/RefundVault.sol
+4
-4
RefundableCrowdsale.sol
contracts/crowdsale/RefundableCrowdsale.sol
+1
-1
Destructible.sol
contracts/lifecycle/Destructible.sol
+2
-2
Migrations.sol
contracts/lifecycle/Migrations.sol
+2
-2
Pausable.sol
contracts/lifecycle/Pausable.sol
+2
-2
TokenDestructible.sol
contracts/lifecycle/TokenDestructible.sol
+1
-1
Claimable.sol
contracts/ownership/Claimable.sol
+2
-2
Contactable.sol
contracts/ownership/Contactable.sol
+1
-1
DelayedClaimable.sol
contracts/ownership/DelayedClaimable.sol
+2
-2
Ownable.sol
contracts/ownership/Ownable.sol
+1
-1
PullPayment.sol
contracts/payment/PullPayment.sol
+1
-1
BasicToken.sol
contracts/token/BasicToken.sol
+2
-2
ERC20.sol
contracts/token/ERC20.sol
+3
-3
ERC20Basic.sol
contracts/token/ERC20Basic.sol
+2
-2
LimitedTransferToken.sol
contracts/token/LimitedTransferToken.sol
+3
-3
MintableToken.sol
contracts/token/MintableToken.sol
+2
-2
PausableToken.sol
contracts/token/PausableToken.sol
+2
-2
StandardToken.sol
contracts/token/StandardToken.sol
+3
-3
TokenTimelock.sol
contracts/token/TokenTimelock.sol
+5
-5
VestedToken.sol
contracts/token/VestedToken.sol
+5
-5
No files found.
contracts/Bounty.sol
View file @
b395b06b
...
@@ -27,7 +27,7 @@ contract Bounty is PullPayment, Destructible {
...
@@ -27,7 +27,7 @@ contract Bounty is PullPayment, Destructible {
* msg.sender as a researcher
* msg.sender as a researcher
* @return A target contract
* @return A target contract
*/
*/
function createTarget() returns(Target) {
function createTarget()
public
returns(Target) {
Target target = Target(deployContract());
Target target = Target(deployContract());
researchers[target] = msg.sender;
researchers[target] = msg.sender;
TargetCreated(target);
TargetCreated(target);
...
@@ -44,7 +44,7 @@ contract Bounty is PullPayment, Destructible {
...
@@ -44,7 +44,7 @@ contract Bounty is PullPayment, Destructible {
* @dev Sends the contract funds to the researcher that proved the contract is broken.
* @dev Sends the contract funds to the researcher that proved the contract is broken.
* @param target contract
* @param target contract
*/
*/
function claim(Target target) {
function claim(Target target)
public
{
address researcher = researchers[target];
address researcher = researchers[target];
require(researcher != 0);
require(researcher != 0);
// Check Target contract invariants
// Check Target contract invariants
...
@@ -68,5 +68,5 @@ contract Target {
...
@@ -68,5 +68,5 @@ contract Target {
* In order to win the bounty, security researchers will try to cause this broken state.
* In order to win the bounty, security researchers will try to cause this broken state.
* @return True if all invariant values are correct, false otherwise.
* @return True if all invariant values are correct, false otherwise.
*/
*/
function checkInvariant() returns(bool);
function checkInvariant()
public
returns(bool);
}
}
contracts/ECRecovery.sol
View file @
b395b06b
...
@@ -14,7 +14,7 @@ library ECRecovery {
...
@@ -14,7 +14,7 @@ library ECRecovery {
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @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 sig bytes signature, the signature is generated using web3.eth.sign()
*/
*/
function recover(bytes32 hash, bytes sig) constant returns (address) {
function recover(bytes32 hash, bytes sig)
public
constant returns (address) {
bytes32 r;
bytes32 r;
bytes32 s;
bytes32 s;
uint8 v;
uint8 v;
...
...
contracts/crowdsale/Crowdsale.sol
View file @
b395b06b
...
@@ -66,7 +66,7 @@ contract Crowdsale {
...
@@ -66,7 +66,7 @@ contract Crowdsale {
}
}
// low level token purchase function
// low level token purchase function
function buyTokens(address beneficiary) payable {
function buyTokens(address beneficiary) p
ublic p
ayable {
require(beneficiary != 0x0);
require(beneficiary != 0x0);
require(validPurchase());
require(validPurchase());
...
...
contracts/crowdsale/FinalizableCrowdsale.sol
View file @
b395b06b
...
@@ -20,7 +20,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable {
...
@@ -20,7 +20,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable {
* @dev Must be called after crowdsale ends, to do some extra finalization
* @dev Must be called after crowdsale ends, to do some extra finalization
* work. Calls the contract's finalization function.
* work. Calls the contract's finalization function.
*/
*/
function finalize() onlyOwner {
function finalize() onlyOwner
public
{
require(!isFinalized);
require(!isFinalized);
require(hasEnded());
require(hasEnded());
...
...
contracts/crowdsale/RefundVault.sol
View file @
b395b06b
...
@@ -28,25 +28,25 @@ contract RefundVault is Ownable {
...
@@ -28,25 +28,25 @@ contract RefundVault is Ownable {
state = State.Active;
state = State.Active;
}
}
function deposit(address investor) onlyOwner payable {
function deposit(address investor) onlyOwner p
ublic p
ayable {
require(state == State.Active);
require(state == State.Active);
deposited[investor] = deposited[investor].add(msg.value);
deposited[investor] = deposited[investor].add(msg.value);
}
}
function close() onlyOwner {
function close() onlyOwner
public
{
require(state == State.Active);
require(state == State.Active);
state = State.Closed;
state = State.Closed;
Closed();
Closed();
wallet.transfer(this.balance);
wallet.transfer(this.balance);
}
}
function enableRefunds() onlyOwner {
function enableRefunds() onlyOwner
public
{
require(state == State.Active);
require(state == State.Active);
state = State.Refunding;
state = State.Refunding;
RefundsEnabled();
RefundsEnabled();
}
}
function refund(address investor) {
function refund(address investor)
public
{
require(state == State.Refunding);
require(state == State.Refunding);
uint256 depositedValue = deposited[investor];
uint256 depositedValue = deposited[investor];
deposited[investor] = 0;
deposited[investor] = 0;
...
...
contracts/crowdsale/RefundableCrowdsale.sol
View file @
b395b06b
...
@@ -35,7 +35,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
...
@@ -35,7 +35,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
}
}
// if crowdsale is unsuccessful, investors can claim refunds here
// if crowdsale is unsuccessful, investors can claim refunds here
function claimRefund() {
function claimRefund()
public
{
require(isFinalized);
require(isFinalized);
require(!goalReached());
require(!goalReached());
...
...
contracts/lifecycle/Destructible.sol
View file @
b395b06b
...
@@ -15,11 +15,11 @@ contract Destructible is Ownable {
...
@@ -15,11 +15,11 @@ contract Destructible is Ownable {
/**
/**
* @dev Transfers the current balance to the owner and terminates the contract.
* @dev Transfers the current balance to the owner and terminates the contract.
*/
*/
function destroy() onlyOwner {
function destroy() onlyOwner
public
{
selfdestruct(owner);
selfdestruct(owner);
}
}
function destroyAndSend(address _recipient) onlyOwner {
function destroyAndSend(address _recipient) onlyOwner
public
{
selfdestruct(_recipient);
selfdestruct(_recipient);
}
}
}
}
contracts/lifecycle/Migrations.sol
View file @
b395b06b
...
@@ -10,11 +10,11 @@ import '../ownership/Ownable.sol';
...
@@ -10,11 +10,11 @@ import '../ownership/Ownable.sol';
contract Migrations is Ownable {
contract Migrations is Ownable {
uint256 public lastCompletedMigration;
uint256 public lastCompletedMigration;
function setCompleted(uint256 completed) onlyOwner {
function setCompleted(uint256 completed) onlyOwner
public
{
lastCompletedMigration = completed;
lastCompletedMigration = completed;
}
}
function upgrade(address newAddress) onlyOwner {
function upgrade(address newAddress) onlyOwner
public
{
Migrations upgraded = Migrations(newAddress);
Migrations upgraded = Migrations(newAddress);
upgraded.setCompleted(lastCompletedMigration);
upgraded.setCompleted(lastCompletedMigration);
}
}
...
...
contracts/lifecycle/Pausable.sol
View file @
b395b06b
...
@@ -34,7 +34,7 @@ contract Pausable is Ownable {
...
@@ -34,7 +34,7 @@ contract Pausable is Ownable {
/**
/**
* @dev called by the owner to pause, triggers stopped state
* @dev called by the owner to pause, triggers stopped state
*/
*/
function pause() onlyOwner whenNotPaused {
function pause() onlyOwner whenNotPaused
public
{
paused = true;
paused = true;
Pause();
Pause();
}
}
...
@@ -42,7 +42,7 @@ contract Pausable is Ownable {
...
@@ -42,7 +42,7 @@ contract Pausable is Ownable {
/**
/**
* @dev called by the owner to unpause, returns to normal state
* @dev called by the owner to unpause, returns to normal state
*/
*/
function unpause() onlyOwner whenPaused {
function unpause() onlyOwner whenPaused
public
{
paused = false;
paused = false;
Unpause();
Unpause();
}
}
...
...
contracts/lifecycle/TokenDestructible.sol
View file @
b395b06b
...
@@ -21,7 +21,7 @@ contract TokenDestructible is Ownable {
...
@@ -21,7 +21,7 @@ contract TokenDestructible is Ownable {
* @notice The called token contracts could try to re-enter this contract. Only
* @notice The called token contracts could try to re-enter this contract. Only
supply token contracts you trust.
supply token contracts you trust.
*/
*/
function destroy(address[] tokens) onlyOwner {
function destroy(address[] tokens) onlyOwner
public
{
// Transfer tokens to owner
// Transfer tokens to owner
for(uint256 i = 0; i < tokens.length; i++) {
for(uint256 i = 0; i < tokens.length; i++) {
...
...
contracts/ownership/Claimable.sol
View file @
b395b06b
...
@@ -24,14 +24,14 @@ contract Claimable is Ownable {
...
@@ -24,14 +24,14 @@ contract Claimable is Ownable {
* @dev Allows the current owner to set the pendingOwner address.
* @dev Allows the current owner to set the pendingOwner address.
* @param newOwner The address to transfer ownership to.
* @param newOwner The address to transfer ownership to.
*/
*/
function transferOwnership(address newOwner) onlyOwner {
function transferOwnership(address newOwner) onlyOwner
public
{
pendingOwner = newOwner;
pendingOwner = newOwner;
}
}
/**
/**
* @dev Allows the pendingOwner address to finalize the transfer.
* @dev Allows the pendingOwner address to finalize the transfer.
*/
*/
function claimOwnership() onlyPendingOwner {
function claimOwnership() onlyPendingOwner
public
{
OwnershipTransferred(owner, pendingOwner);
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
owner = pendingOwner;
pendingOwner = 0x0;
pendingOwner = 0x0;
...
...
contracts/ownership/Contactable.sol
View file @
b395b06b
...
@@ -15,7 +15,7 @@ contract Contactable is Ownable{
...
@@ -15,7 +15,7 @@ contract Contactable is Ownable{
* @dev Allows the owner to set a string with their contact information.
* @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{
function setContactInformation(string info) onlyOwner
public
{
contactInformation = info;
contactInformation = info;
}
}
}
}
contracts/ownership/DelayedClaimable.sol
View file @
b395b06b
...
@@ -20,7 +20,7 @@ contract DelayedClaimable is Claimable {
...
@@ -20,7 +20,7 @@ contract DelayedClaimable is Claimable {
* @param _start The earliest time ownership can be claimed.
* @param _start The earliest time ownership can be claimed.
* @param _end The latest time ownership can be claimed.
* @param _end The latest time ownership can be claimed.
*/
*/
function setLimits(uint256 _start, uint256 _end) onlyOwner {
function setLimits(uint256 _start, uint256 _end) onlyOwner
public
{
require(_start <= _end);
require(_start <= _end);
end = _end;
end = _end;
start = _start;
start = _start;
...
@@ -31,7 +31,7 @@ contract DelayedClaimable is Claimable {
...
@@ -31,7 +31,7 @@ contract DelayedClaimable is Claimable {
* @dev Allows the pendingOwner address to finalize the transfer, as long as it is called within
* @dev Allows the pendingOwner address to finalize the transfer, as long as it is called within
* the specified start and end time.
* the specified start and end time.
*/
*/
function claimOwnership() onlyPendingOwner {
function claimOwnership() onlyPendingOwner
public
{
require((block.number <= end) && (block.number >= start));
require((block.number <= end) && (block.number >= start));
OwnershipTransferred(owner, pendingOwner);
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
owner = pendingOwner;
...
...
contracts/ownership/Ownable.sol
View file @
b395b06b
...
@@ -35,7 +35,7 @@ contract Ownable {
...
@@ -35,7 +35,7 @@ contract Ownable {
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
* @param newOwner The address to transfer ownership to.
*/
*/
function transferOwnership(address newOwner) onlyOwner {
function transferOwnership(address newOwner) onlyOwner
public
{
require(newOwner != address(0));
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
owner = newOwner;
...
...
contracts/payment/PullPayment.sol
View file @
b395b06b
...
@@ -28,7 +28,7 @@ contract PullPayment {
...
@@ -28,7 +28,7 @@ contract PullPayment {
/**
/**
* @dev withdraw accumulated balance, called by payee.
* @dev withdraw accumulated balance, called by payee.
*/
*/
function withdrawPayments() {
function withdrawPayments()
public
{
address payee = msg.sender;
address payee = msg.sender;
uint256 payment = payments[payee];
uint256 payment = payments[payee];
...
...
contracts/token/BasicToken.sol
View file @
b395b06b
...
@@ -19,7 +19,7 @@ contract BasicToken is ERC20Basic {
...
@@ -19,7 +19,7 @@ contract BasicToken is ERC20Basic {
* @param _to The address to transfer to.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _value The amount to be transferred.
*/
*/
function transfer(address _to, uint256 _value) returns (bool) {
function transfer(address _to, uint256 _value)
public
returns (bool) {
require(_to != address(0));
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
// SafeMath.sub will throw if there is not enough balance.
...
@@ -34,7 +34,7 @@ contract BasicToken is ERC20Basic {
...
@@ -34,7 +34,7 @@ contract BasicToken is ERC20Basic {
* @param _owner The address to query the the balance of.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
* @return An uint256 representing the amount owned by the passed address.
*/
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
function balanceOf(address _owner)
public
constant returns (uint256 balance) {
return balances[_owner];
return balances[_owner];
}
}
...
...
contracts/token/ERC20.sol
View file @
b395b06b
...
@@ -9,8 +9,8 @@ import './ERC20Basic.sol';
...
@@ -9,8 +9,8 @@ import './ERC20Basic.sol';
* @dev see https://github.com/ethereum/EIPs/issues/20
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
*/
contract ERC20 is ERC20Basic {
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function allowance(address owner, address spender)
public
constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function transferFrom(address from, address to, uint256 value)
public
returns (bool);
function approve(address spender, uint256 value) returns (bool);
function approve(address spender, uint256 value)
public
returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
}
contracts/token/ERC20Basic.sol
View file @
b395b06b
...
@@ -8,7 +8,7 @@ pragma solidity ^0.4.11;
...
@@ -8,7 +8,7 @@ pragma solidity ^0.4.11;
*/
*/
contract ERC20Basic {
contract ERC20Basic {
uint256 public totalSupply;
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function balanceOf(address who)
public
constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
function transfer(address to, uint256 value)
public
returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
}
contracts/token/LimitedTransferToken.sol
View file @
b395b06b
...
@@ -32,7 +32,7 @@ contract LimitedTransferToken is ERC20 {
...
@@ -32,7 +32,7 @@ contract LimitedTransferToken is ERC20 {
* @param _to The address that will recieve the tokens.
* @param _to The address that will recieve the tokens.
* @param _value The amount of tokens to be transferred.
* @param _value The amount of tokens to be transferred.
*/
*/
function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value) returns (bool) {
function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value)
public
returns (bool) {
return super.transfer(_to, _value);
return super.transfer(_to, _value);
}
}
...
@@ -42,7 +42,7 @@ contract LimitedTransferToken is ERC20 {
...
@@ -42,7 +42,7 @@ contract LimitedTransferToken is ERC20 {
* @param _to The address that will recieve the tokens.
* @param _to The address that will recieve the tokens.
* @param _value The amount of tokens to be transferred.
* @param _value The amount of tokens to be transferred.
*/
*/
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from, _value) returns (bool) {
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from, _value)
public
returns (bool) {
return super.transferFrom(_from, _to, _value);
return super.transferFrom(_from, _to, _value);
}
}
...
@@ -51,7 +51,7 @@ contract LimitedTransferToken is ERC20 {
...
@@ -51,7 +51,7 @@ contract LimitedTransferToken is ERC20 {
* @dev Overwriting transferableTokens(address holder, uint64 time) is the way to provide the
* @dev Overwriting transferableTokens(address holder, uint64 time) is the way to provide the
* specific logic for limiting token transferability for a holder over time.
* specific logic for limiting token transferability for a holder over time.
*/
*/
function transferableTokens(address holder, uint64 time)
constant public
returns (uint256) {
function transferableTokens(address holder, uint64 time)
public constant
returns (uint256) {
return balanceOf(holder);
return balanceOf(holder);
}
}
}
}
contracts/token/MintableToken.sol
View file @
b395b06b
...
@@ -31,7 +31,7 @@ contract MintableToken is StandardToken, Ownable {
...
@@ -31,7 +31,7 @@ contract MintableToken is StandardToken, Ownable {
* @param _amount The amount of tokens to mint.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
* @return A boolean that indicates if the operation was successful.
*/
*/
function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) {
function mint(address _to, uint256 _amount) onlyOwner canMint
public
returns (bool) {
totalSupply = totalSupply.add(_amount);
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Mint(_to, _amount);
...
@@ -43,7 +43,7 @@ contract MintableToken is StandardToken, Ownable {
...
@@ -43,7 +43,7 @@ contract MintableToken is StandardToken, Ownable {
* @dev Function to stop minting new tokens.
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
* @return True if the operation was successful.
*/
*/
function finishMinting() onlyOwner returns (bool) {
function finishMinting() onlyOwner
public
returns (bool) {
mintingFinished = true;
mintingFinished = true;
MintFinished();
MintFinished();
return true;
return true;
...
...
contracts/token/PausableToken.sol
View file @
b395b06b
...
@@ -11,11 +11,11 @@ import '../lifecycle/Pausable.sol';
...
@@ -11,11 +11,11 @@ import '../lifecycle/Pausable.sol';
contract PausableToken is StandardToken, Pausable {
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) whenNotPaused returns (bool) {
function transfer(address _to, uint256 _value) whenNotPaused
public
returns (bool) {
return super.transfer(_to, _value);
return super.transfer(_to, _value);
}
}
function transferFrom(address _from, address _to, uint256 _value) whenNotPaused returns (bool) {
function transferFrom(address _from, address _to, uint256 _value) whenNotPaused
public
returns (bool) {
return super.transferFrom(_from, _to, _value);
return super.transferFrom(_from, _to, _value);
}
}
}
}
contracts/token/StandardToken.sol
View file @
b395b06b
...
@@ -23,7 +23,7 @@ contract StandardToken is ERC20, BasicToken {
...
@@ -23,7 +23,7 @@ contract StandardToken is ERC20, BasicToken {
* @param _to address The address which you want to transfer to
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
* @param _value uint256 the amount of tokens to be transferred
*/
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
function transferFrom(address _from, address _to, uint256 _value)
public
returns (bool) {
require(_to != address(0));
require(_to != address(0));
var _allowance = allowed[_from][msg.sender];
var _allowance = allowed[_from][msg.sender];
...
@@ -43,7 +43,7 @@ contract StandardToken is ERC20, BasicToken {
...
@@ -43,7 +43,7 @@ contract StandardToken is ERC20, BasicToken {
* @param _spender The address which will spend the funds.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
* @param _value The amount of tokens to be spent.
*/
*/
function approve(address _spender, uint256 _value) returns (bool) {
function approve(address _spender, uint256 _value)
public
returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// allowance to zero by calling `approve(_spender, 0)` if it is not
...
@@ -62,7 +62,7 @@ contract StandardToken is ERC20, BasicToken {
...
@@ -62,7 +62,7 @@ contract StandardToken is ERC20, BasicToken {
* @param _spender address The address which will spend the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
function allowance(address _owner, address _spender)
public
constant returns (uint256 remaining) {
return allowed[_owner][_spender];
return allowed[_owner][_spender];
}
}
...
...
contracts/token/TokenTimelock.sol
View file @
b395b06b
...
@@ -13,13 +13,13 @@ contract TokenTimelock {
...
@@ -13,13 +13,13 @@ contract TokenTimelock {
using SafeERC20 for ERC20Basic;
using SafeERC20 for ERC20Basic;
// ERC20 basic token contract being held
// ERC20 basic token contract being held
ERC20Basic token;
ERC20Basic
public
token;
// beneficiary of tokens after they are released
// beneficiary of tokens after they are released
address beneficiary;
address
public
beneficiary;
// timestamp when token release is enabled
// timestamp when token release is enabled
uint64 releaseTime;
uint64
public
releaseTime;
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint64 _releaseTime) {
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint64 _releaseTime) {
require(_releaseTime > now);
require(_releaseTime > now);
...
@@ -32,7 +32,7 @@ contract TokenTimelock {
...
@@ -32,7 +32,7 @@ contract TokenTimelock {
* @notice Transfers tokens held by timelock to beneficiary.
* @notice Transfers tokens held by timelock to beneficiary.
* Deprecated: please use TokenTimelock#release instead.
* Deprecated: please use TokenTimelock#release instead.
*/
*/
function claim() {
function claim()
public
{
require(msg.sender == beneficiary);
require(msg.sender == beneficiary);
release();
release();
}
}
...
@@ -40,7 +40,7 @@ contract TokenTimelock {
...
@@ -40,7 +40,7 @@ contract TokenTimelock {
/**
/**
* @notice Transfers tokens held by timelock to beneficiary.
* @notice Transfers tokens held by timelock to beneficiary.
*/
*/
function release() {
function release()
public
{
require(now >= releaseTime);
require(now >= releaseTime);
uint256 amount = token.balanceOf(this);
uint256 amount = token.balanceOf(this);
...
...
contracts/token/VestedToken.sol
View file @
b395b06b
...
@@ -99,7 +99,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
...
@@ -99,7 +99,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
* @param time uint64 The specific time.
* @param time uint64 The specific time.
* @return An uint256 representing a holder's total amount of transferable tokens.
* @return An uint256 representing a holder's total amount of transferable tokens.
*/
*/
function transferableTokens(address holder, uint64 time)
constant public
returns (uint256) {
function transferableTokens(address holder, uint64 time)
public constant
returns (uint256) {
uint256 grantIndex = tokenGrantsCount(holder);
uint256 grantIndex = tokenGrantsCount(holder);
if (grantIndex == 0) return super.transferableTokens(holder, time); // shortcut for holder without grants
if (grantIndex == 0) return super.transferableTokens(holder, time); // shortcut for holder without grants
...
@@ -123,7 +123,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
...
@@ -123,7 +123,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
* @param _holder The holder of the grants.
* @param _holder The holder of the grants.
* @return A uint256 representing the total amount of grants.
* @return A uint256 representing the total amount of grants.
*/
*/
function tokenGrantsCount(address _holder) constant returns (uint256 index) {
function tokenGrantsCount(address _holder)
public
constant returns (uint256 index) {
return grants[_holder].length;
return grants[_holder].length;
}
}
...
@@ -156,7 +156,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
...
@@ -156,7 +156,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
uint256 time,
uint256 time,
uint256 start,
uint256 start,
uint256 cliff,
uint256 cliff,
uint256 vesting) constant returns (uint256)
uint256 vesting)
public
constant returns (uint256)
{
{
// Shortcuts for before cliff and after vesting cases.
// Shortcuts for before cliff and after vesting cases.
if (time < cliff) return 0;
if (time < cliff) return 0;
...
@@ -185,7 +185,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
...
@@ -185,7 +185,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
* @return Returns all the values that represent a TokenGrant(address, value, start, cliff,
* @return Returns all the values that represent a TokenGrant(address, value, start, cliff,
* revokability, burnsOnRevoke, and vesting) plus the vested value at the current time.
* revokability, burnsOnRevoke, and vesting) plus the vested value at the current time.
*/
*/
function tokenGrant(address _holder, uint256 _grantId) constant returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting, bool revokable, bool burnsOnRevoke) {
function tokenGrant(address _holder, uint256 _grantId)
public
constant returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting, bool revokable, bool burnsOnRevoke) {
TokenGrant storage grant = grants[_holder][_grantId];
TokenGrant storage grant = grants[_holder][_grantId];
granter = grant.granter;
granter = grant.granter;
...
@@ -231,7 +231,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
...
@@ -231,7 +231,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
* @param holder address The address of the holder
* @param holder address The address of the holder
* @return An uint256 representing the date of the last transferable tokens.
* @return An uint256 representing the date of the last transferable tokens.
*/
*/
function lastTokenIsTransferableDate(address holder)
constant public
returns (uint64 date) {
function lastTokenIsTransferableDate(address holder)
public constant
returns (uint64 date) {
date = uint64(now);
date = uint64(now);
uint256 grantIndex = grants[holder].length;
uint256 grantIndex = grants[holder].length;
for (uint256 i = 0; i < grantIndex; i++) {
for (uint256 i = 0; i < grantIndex; i++) {
...
...
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