Skip to content
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

UtilityTokenAbstract: construct with and expose UUID invariants #97

Merged
merged 1 commit into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 55 additions & 47 deletions contracts/BrandedToken.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* solhint-disable-next-line compiler-fixed */
pragma solidity ^0.4.17;

// Copyright 2017 OpenST Ltd.
Expand Down Expand Up @@ -27,6 +28,7 @@ import "./SafeMath.sol";
import "./EIP20Token.sol";
import "./UtilityTokenAbstract.sol";


/// @dev Branded Token is an EIP20 token minted by staking Simple Token
/// on Ethereum mainnet. Branded tokens are designed to be used
/// within a (decentralised) application and support:
Expand All @@ -38,59 +40,65 @@ import "./UtilityTokenAbstract.sol";
/// their equivalent part of the Simple Token stake
/// on Ethereum (before v1.0)
contract BrandedToken is EIP20Token, UtilityTokenAbstract {
using SafeMath for uint256;

/*
* Public functions
*/
function BrandedToken(
address _openSTProtocol,
bytes32 _uuid,
string _symbol,
string _name,
uint8 _decimals)
EIP20Token(_symbol, _name, _decimals)
UtilityTokenAbstract(_openSTProtocol, _uuid)
public
{
using SafeMath for uint256;

}
/*
* Public functions
*/
function BrandedToken(
bytes32 _uuid,
string _symbol,
string _name,
uint8 _decimals,
uint256 _chainIdValue,
uint256 _chainIdUtility,
uint256 _conversionRate)
public
EIP20Token(_symbol, _name, _decimals)
UtilityTokenAbstract(
_uuid,
_symbol,
_name,
_chainIdValue,
_chainIdUtility,
_conversionRate)
{ }

function claim(
address _beneficiary)
public
returns (bool /* success */)
{
uint256 amount = claimInternal(_beneficiary);
function claim(
address _beneficiary)
public
returns (bool /* success */)
{
uint256 amount = claimInternal(_beneficiary);

return claimEIP20(_beneficiary, amount);
}
return claimEIP20(_beneficiary, amount);
}

function mint(
address _beneficiary,
uint256 _amount)
public
onlyProtocol
returns (bool /* success */)
{
mintEIP20(_amount);
function mint(
address _beneficiary,
uint256 _amount)
public
onlyProtocol
returns (bool /* success */)
{
mintEIP20(_amount);

return mintInternal(_beneficiary, _amount);
}
return mintInternal(_beneficiary, _amount);
}

function burn(
address _burner,
uint256 _amount)
public
onlyProtocol
payable
returns (bool /* success */)
{
// force non-payable, as only ST' handles in base tokens
require(msg.value == 0);
function burn(
address _burner,
uint256 _amount)
public
onlyProtocol
payable
returns (bool /* success */)
{
// force non-payable, as only ST' handles in base tokens
require(msg.value == 0);

burnEIP20(_amount);
burnEIP20(_amount);

return burnInternal(_burner, _amount);
}
return burnInternal(_burner, _amount);
}
}
Loading