Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
}); | ||
}); |