@0xcert/ethereum-erc20-contracts
Advanced tools
Comparing version 1.0.0-rc1 to 1.0.0-rc10
@@ -263,3 +263,3 @@ { | ||
"transfer(address,uint256)": { | ||
"details": "Transfers _value amount of tokens to address _to, and MUST fire the Transfer event. The function SHOULD throw if the _from account balance does not have enough tokens to spend.", | ||
"details": "Transfers _value amount of tokens to address _to, and MUST fire the Transfer event. The function SHOULD throw if the message caller's account balance does not have enough tokens to spend.", | ||
"params": { | ||
@@ -266,0 +266,0 @@ "_to": "The address of the recipient.", |
@@ -123,12 +123,2 @@ "use strict"; | ||
})); | ||
spec.test('reverts if owner wants to reset allowance before setting it to 0 first', (ctx) => __awaiter(this, void 0, void 0, function* () { | ||
const token = ctx.get('token'); | ||
const owner = ctx.get('owner'); | ||
const bob = ctx.get('bob'); | ||
const decimalsMul = ctx.get('decimalsMul'); | ||
const tokenAmount = decimalsMul.mul(new ctx.web3.utils.BN('100')); | ||
const newTokenAmount = decimalsMul.mul(new ctx.web3.utils.BN('50')); | ||
yield token.instance.methods.approve(bob, tokenAmount.toString()).send({ from: owner }); | ||
yield ctx.reverts(() => token.instance.methods.approve(bob, newTokenAmount.toString()).send({ from: owner }), '001002'); | ||
})); | ||
spec.test('successfully resets allowance', (ctx) => __awaiter(this, void 0, void 0, function* () { | ||
@@ -184,3 +174,3 @@ const token = ctx.get('token'); | ||
yield token.instance.methods.approve(bob, tokenAmountAllowed.toString()).send({ from: owner }); | ||
yield ctx.reverts(() => token.instance.methods.transferFrom(owner, sara, tokenAmount.toString()).send({ from: bob }), '001003'); | ||
yield ctx.reverts(() => token.instance.methods.transferFrom(owner, sara, tokenAmount.toString()).send({ from: bob }), '001002'); | ||
})); | ||
@@ -187,0 +177,0 @@ spec.test('throws an error when trying to transferFrom more than _from has', (ctx) => __awaiter(this, void 0, void 0, function* () { |
{ | ||
"files": {}, | ||
"files": { | ||
"packages/0xcert-ethereum-erc20-contracts/README.md": "2a7e42a331e6ff588f7630463a89503289377d2b", | ||
"packages/0xcert-ethereum-erc20-contracts/nodemon.json": "82b893373db9861f1df4b55d8ea68a5d37b118de", | ||
"packages/0xcert-ethereum-erc20-contracts/package.json": "558033e103ad959fe0cfb0fcb8c8dfc2395c6970", | ||
"packages/0xcert-ethereum-erc20-contracts/src/contracts/erc20.sol": "070ba4bdb492cdba1afd7a54929bce9fbfb27546", | ||
"packages/0xcert-ethereum-erc20-contracts/src/contracts/mocks/token-mock.sol": "64e1f38a1b0034519cc6774a4cfa54578b082b1c", | ||
"packages/0xcert-ethereum-erc20-contracts/src/contracts/token.sol": "00bd8e3749500e6303ff5ee481698ac40a626d7d", | ||
"packages/0xcert-ethereum-erc20-contracts/src/tests/token.test.ts": "a7b344c14e2f77ba72bc66e39133d137c65e7cb3", | ||
"packages/0xcert-ethereum-erc20-contracts/tsconfig.json": "4aeac3c20e45b7e477e82012eb7788f7dbb11bf3", | ||
"packages/0xcert-ethereum-erc20-contracts/tslint.json": "c57b3f0cdb7aa74ab2ab02888380f613589cbe66", | ||
"common/config/rush/npm-shrinkwrap.json": "b56bf5d9342bdd909289a88c77e60988dcde36a8" | ||
}, | ||
"arguments": "npm run lint && npm run clean && npx specron compile && npx specron test " | ||
} |
{ | ||
"name": "@0xcert/ethereum-erc20-contracts", | ||
"version": "1.0.0-rc1", | ||
"version": "1.0.0-rc10", | ||
"description": "Smart contract implementation of the ERC-20 standard on the Ethereum blockchain.", | ||
@@ -64,5 +64,5 @@ "scripts": { | ||
"devDependencies": { | ||
"@0xcert/ethereum-utils-contracts": "1.0.0-rc1", | ||
"@specron/cli": "^0.5.1", | ||
"@specron/spec": "^0.5.1", | ||
"@0xcert/ethereum-utils-contracts": "1.0.0-rc10", | ||
"@specron/cli": "^0.5.6", | ||
"@specron/spec": "^0.5.6", | ||
"solc": "0.5.1", | ||
@@ -72,4 +72,4 @@ "ts-node": "^7.0.1", | ||
"typescript": "^3.1.1", | ||
"web3": "^1.0.0-beta.36" | ||
"web3": "1.0.0-beta.36" | ||
} | ||
} |
@@ -142,14 +142,2 @@ import { Spec } from '@specron/spec'; | ||
spec.test('reverts if owner wants to reset allowance before setting it to 0 first', async (ctx) => { | ||
const token = ctx.get('token'); | ||
const owner = ctx.get('owner'); | ||
const bob = ctx.get('bob'); | ||
const decimalsMul = ctx.get('decimalsMul'); | ||
const tokenAmount = decimalsMul.mul(new ctx.web3.utils.BN('100')); | ||
const newTokenAmount = decimalsMul.mul(new ctx.web3.utils.BN('50')); | ||
await token.instance.methods.approve(bob, tokenAmount.toString()).send({ from: owner }); | ||
await ctx.reverts(() => token.instance.methods.approve(bob, newTokenAmount.toString()).send({ from: owner }), '001002'); | ||
}); | ||
spec.test('successfully resets allowance', async (ctx) => { | ||
@@ -215,3 +203,3 @@ const token = ctx.get('token'); | ||
await token.instance.methods.approve(bob, tokenAmountAllowed.toString()).send({ from: owner }); | ||
await ctx.reverts(() => token.instance.methods.transferFrom(owner, sara, tokenAmount.toString()).send({ from: bob }), '001003'); | ||
await ctx.reverts(() => token.instance.methods.transferFrom(owner, sara, tokenAmount.toString()).send({ from: bob }), '001002'); | ||
}); | ||
@@ -218,0 +206,0 @@ |
@@ -239,11 +239,2 @@ { | ||
"ban-ts-ignore": true, | ||
"no-console": [ | ||
true, | ||
"log", | ||
"debug", | ||
"info", | ||
"time", | ||
"timeEnd", | ||
"trace" | ||
], | ||
"no-debugger": true, | ||
@@ -250,0 +241,0 @@ "no-eval": true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
823695
24465