Rename SmartToken to ERC827

This commit is contained in:
AugustoL
2018-01-11 13:52:36 -03:00
parent a806520d6f
commit e57f4be1fb
4 changed files with 22 additions and 22 deletions

View File

@ -0,0 +1,15 @@
pragma solidity ^0.4.13;
import '../token/ERC827.sol';
// mock class using ERC827 Token
contract ERC827TokenMock is ERC827 {
function ERC827TokenMock(address initialAccount, uint256 initialBalance) {
balances[initialAccount] = initialBalance;
totalSupply = initialBalance;
}
}

View File

@ -1,15 +0,0 @@
pragma solidity ^0.4.13;
import '../token/SmartToken.sol';
// mock class using SmartToken
contract SmartTokenMock is SmartToken {
function SmartTokenMock(address initialAccount, uint256 initialBalance) {
balances[initialAccount] = initialBalance;
totalSupply = initialBalance;
}
}

View File

@ -3,14 +3,14 @@ pragma solidity ^0.4.13;
import "./StandardToken.sol"; import "./StandardToken.sol";
/** /**
@title SmartToken, an extension of ERC20 token standard @title ERC827, an extension of ERC20 token standard
Implementation the SmartToken, following the ERC20 standard with extra Implementation the ERC827, following the ERC20 standard with extra
methods to transfer value and data and execute calls in transfers and methods to transfer value and data and execute calls in transfers and
approvals. approvals.
Uses OpenZeppelin StandardToken. Uses OpenZeppelin StandardToken.
*/ */
contract SmartToken is StandardToken { contract ERC827 is StandardToken {
/** /**
@dev `approveData` is an addition to ERC20 token methods. It allows to @dev `approveData` is an addition to ERC20 token methods. It allows to

View File

@ -1,7 +1,7 @@
import EVMRevert from './helpers/EVMRevert'; import EVMRevert from './helpers/EVMRevert';
var Message = artifacts.require('./mock/MessageHelper.sol'); var Message = artifacts.require('./mock/MessageHelper.sol');
var SmartTokenMock = artifacts.require('./mock/SmartTokenMock.sol'); var ERC827TokenMock = artifacts.require('./mock/ERC827TokenMock.sol');
var BigNumber = web3.BigNumber; var BigNumber = web3.BigNumber;
@ -10,11 +10,11 @@ require('chai')
.use(require('chai-bignumber')(BigNumber)) .use(require('chai-bignumber')(BigNumber))
.should(); .should();
contract('SmartToken', function (accounts) { contract('ERC827 Token', function (accounts) {
let token; let token;
beforeEach(async function () { beforeEach(async function () {
token = await SmartTokenMock.new(accounts[0], 100); token = await ERC827TokenMock.new(accounts[0], 100);
}); });
it('should return the correct totalSupply after construction', async function () { it('should return the correct totalSupply after construction', async function () {
@ -24,7 +24,7 @@ contract('SmartToken', function (accounts) {
}); });
it('should return the correct allowance amount after approval', async function () { it('should return the correct allowance amount after approval', async function () {
let token = await SmartTokenMock.new(); let token = await ERC827TokenMock.new();
await token.approve(accounts[1], 100); await token.approve(accounts[1], 100);
let allowance = await token.allowance(accounts[0], accounts[1]); let allowance = await token.allowance(accounts[0], accounts[1]);