Skip to content

Commit

Permalink
Merge 970af12 into 54cc981
Browse files Browse the repository at this point in the history
  • Loading branch information
k06a committed Nov 2, 2017
2 parents 54cc981 + 970af12 commit 473888b
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 52 deletions.
27 changes: 0 additions & 27 deletions contracts/BTLToken.sol

This file was deleted.

8 changes: 4 additions & 4 deletions contracts/CATCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "zeppelin-solidity/contracts/crowdsale/FinalizableCrowdsale.sol";
import "./TokensCappedCrowdsale.sol";
import "./PausableCrowdsale.sol";
import "./BonusCrowdsale.sol";
import "./CAToken.sol";
import "./PreCAToken.sol";


/**
Expand Down Expand Up @@ -98,7 +98,7 @@ contract CATCrowdsale is FinalizableCrowdsale, TokensCappedCrowdsale(CATCrowdsal
* @return ERC20 contract associated with the crowdsale
*/
function createTokenContract() internal returns(MintableToken) {
CAToken token = new CAToken();
PreCAToken token = new PreCAToken();
token.pause();
return token;
}
Expand Down Expand Up @@ -128,14 +128,14 @@ contract CATCrowdsale is FinalizableCrowdsale, TokensCappedCrowdsale(CATCrowdsal
* @dev Helper to Pause CAToken
*/
function pauseTokens() public onlyOwner {
CAToken(token).pause();
PreCAToken(token).pause();
}

/**
* @dev Helper to UnPause CAToken
*/
function unpauseTokens() public onlyOwner {
CAToken(token).unpause();
PreCAToken(token).unpause();
}

/**
Expand Down
29 changes: 12 additions & 17 deletions contracts/CAToken.sol
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
pragma solidity ^0.4.11;

import "zeppelin-solidity/contracts/lifecycle/Destructible.sol";
import "./BTLToken.sol";
import "zeppelin-solidity/contracts/token/MintableToken.sol";
import "zeppelin-solidity/contracts/token/PausableToken.sol";


/**
* @dev Main Bitcalve PreCAT token ERC20 contract
* @dev Pre main Bitcalve CAT token ERC20 contract
* Based on references from OpenZeppelin: https://github.com/OpenZeppelin/zeppelin-solidity
*/
contract CAToken is BTLToken, Destructible {

contract CAToken is MintableToken, PausableToken {
// Metadata
string public constant symbol = "CAT";
string public constant name = "Consumer Activity Token";
uint8 public constant decimals = 18;
string public constant version = "1.0";

// Overrided destructor
function destroy() public onlyOwner {
require(mintingFinished);
super.destroy();
}
string public constant version = "2.0";

// Overrided destructor companion
function destroyAndSend(address _recipient) public onlyOwner {
require(mintingFinished);
super.destroyAndSend(_recipient);
/**
* @dev Override MintableTokenn.finishMinting() to add canMint modifier
*/
function finishMinting() onlyOwner canMint public returns(bool) {
return super.finishMinting();
}

}
}
31 changes: 31 additions & 0 deletions contracts/PreCAToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
pragma solidity ^0.4.11;

import "zeppelin-solidity/contracts/lifecycle/Destructible.sol";
import "./CAToken.sol";


/**
* @dev Main Bitcalve PreCAT token ERC20 contract
* Based on references from OpenZeppelin: https://github.com/OpenZeppelin/zeppelin-solidity
*/
contract PreCAToken is CAToken, Destructible {

// Metadata
string public constant symbol = "CAT";
string public constant name = "Consumer Activity Token";
uint8 public constant decimals = 18;
string public constant version = "1.0";

// Overrided destructor
function destroy() public onlyOwner {
require(mintingFinished);
super.destroy();
}

// Overrided destructor companion
function destroyAndSend(address _recipient) public onlyOwner {
require(mintingFinished);
super.destroyAndSend(_recipient);
}

}
2 changes: 1 addition & 1 deletion test/BaseCrowdsaleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const should = require('chai')
.should();

const Crowdsale = artifacts.require('./CATCrowdsale.sol');
const Token = artifacts.require('./CAToken.sol');
const Token = artifacts.require('./PreCAToken.sol');

const tokenDecimals = 18;
const tokenDecimalsIncrease = new BigNumber(10).pow(tokenDecimals);
Expand Down
2 changes: 1 addition & 1 deletion test/CATCrowdsale.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import latestTime from './helpers/latestTime';
import EVMThrow from './helpers/EVMThrow';

const Crowdsale = artifacts.require('./CATCrowdsale.sol');
const Token = artifacts.require('./CAToken.sol');
const Token = artifacts.require('./PreCAToken.sol');

contract('CATCrowdsale', function ([_, wallet, remainingsWallet, bitClaveWallet, wallet2, remainingsWallet2]) {

Expand Down
2 changes: 1 addition & 1 deletion test/CAToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {increaseTimeTo, duration} from './helpers/increaseTime';
import latestTime from './helpers/latestTime';
import EVMThrow from './helpers/EVMThrow';

const Token = artifacts.require('./CAToken.sol');
const Token = artifacts.require('./PreCAToken.sol');

contract('CAToken', function ([_, wallet1, wallet2]) {

Expand Down
2 changes: 1 addition & 1 deletion test/ZepCATCrowdsale.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const should = require('chai')
.should()

const Crowdsale = artifacts.require('./CATCrowdsale.sol')
const CAToken = artifacts.require('./CAToken.sol');
const CAToken = artifacts.require('./PreCAToken.sol');

contract('Crowdsale random tests', function ([_, investor, wallet, purchaser, bitClaveWallet, wallet2, wallet3, wallet4]) {

Expand Down

0 comments on commit 473888b

Please sign in to comment.