From e57f4be1fb52b93152b2221c661a27f94f6d15fe Mon Sep 17 00:00:00 2001 From: AugustoL Date: Thu, 11 Jan 2018 13:52:36 -0300 Subject: [PATCH] Rename SmartToken to ERC827 --- contracts/mocks/ERC827TokenMock.sol | 15 +++++++++++++++ contracts/mocks/SmartTokenMock.sol | 15 --------------- contracts/token/{SmartToken.sol => ERC827.sol} | 6 +++--- test/{SmartToken.js => ERC827Token.js} | 8 ++++---- 4 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 contracts/mocks/ERC827TokenMock.sol delete mode 100644 contracts/mocks/SmartTokenMock.sol rename contracts/token/{SmartToken.sol => ERC827.sol} (93%) rename test/{SmartToken.js => ERC827Token.js} (97%) diff --git a/contracts/mocks/ERC827TokenMock.sol b/contracts/mocks/ERC827TokenMock.sol new file mode 100644 index 000000000..1bc91174e --- /dev/null +++ b/contracts/mocks/ERC827TokenMock.sol @@ -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; + } + +} diff --git a/contracts/mocks/SmartTokenMock.sol b/contracts/mocks/SmartTokenMock.sol deleted file mode 100644 index 37edbcee4..000000000 --- a/contracts/mocks/SmartTokenMock.sol +++ /dev/null @@ -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; - } - -} diff --git a/contracts/token/SmartToken.sol b/contracts/token/ERC827.sol similarity index 93% rename from contracts/token/SmartToken.sol rename to contracts/token/ERC827.sol index cc3ced30f..7729a26a7 100644 --- a/contracts/token/SmartToken.sol +++ b/contracts/token/ERC827.sol @@ -3,14 +3,14 @@ pragma solidity ^0.4.13; 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 approvals. Uses OpenZeppelin StandardToken. */ -contract SmartToken is StandardToken { +contract ERC827 is StandardToken { /** @dev `approveData` is an addition to ERC20 token methods. It allows to diff --git a/test/SmartToken.js b/test/ERC827Token.js similarity index 97% rename from test/SmartToken.js rename to test/ERC827Token.js index 54c67665c..38ed77570 100644 --- a/test/SmartToken.js +++ b/test/ERC827Token.js @@ -1,7 +1,7 @@ import EVMRevert from './helpers/EVMRevert'; 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; @@ -10,11 +10,11 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -contract('SmartToken', function (accounts) { +contract('ERC827 Token', function (accounts) { let token; 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 () { @@ -24,7 +24,7 @@ contract('SmartToken', function (accounts) { }); 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); let allowance = await token.allowance(accounts[0], accounts[1]);