Skip to content

Commit

Permalink
Added initial StoxSmartToken.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeder committed Jul 20, 2017
1 parent b6f4602 commit 3c34632
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
13 changes: 13 additions & 0 deletions contracts/StoxSmartToken.sol
@@ -0,0 +1,13 @@
pragma solidity ^0.4.11;

import 'bancor-contracts/solidity/contracts/SmartToken.sol';

import './SaferMath.sol';

/// @title Stox Smart Token
contract StoxSmartToken is SmartToken {
using SaferMath for uint256;

function StoxSmartToken() SmartToken('Stox Token', 'STX', 18) {
}
}
11 changes: 9 additions & 2 deletions migrations/2_deploy_contracts.js
@@ -1,7 +1,14 @@
const SafeMath = artifacts.require('./SafeMath.sol');
const SaferMath = artifacts.require('./SaferMath.sol');
const Ownable = artifacts.require('./Ownable.sol');

const StoxSmartToken = artifacts.require('./StoxSmartToken.sol');

module.exports = (deployer) => {
deployer.deploy(SafeMath);
deployer.deploy(Ownable);
deployer.deploy(SaferMath);

deployer.link(Ownable, StoxSmartToken);
deployer.link(SaferMath, StoxSmartToken);

deployer.deploy(StoxSmartToken);
};
30 changes: 30 additions & 0 deletions test/StoxSmartToken.js
@@ -0,0 +1,30 @@
import expectThrow from './helpers/expectThrow';

const StoxSmartToken = artifacts.require('../contracts/StoxSmartToken.sol');

contract('StoxSmartToken', (accounts) => {
let token;
let owner = accounts[0];

beforeEach(async () => {
token = await StoxSmartToken.new();
});

describe('construction', async () => {
it('should be ownable', async () => {
assert.equal(await token.owner(), owner);
});

it('should return correct name after construction', async () => {
assert.equal(await token.name(), 'Stox Token');
});

it('should return correct symbol after construction', async () => {
assert.equal(await token.symbol(), 'STX');
});

it('should return correct decimal points after construction', async () => {
assert.equal(await token.decimals(), 18);
});
});
});

0 comments on commit 3c34632

Please sign in to comment.