diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5f82e1c3..e54794db8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,26 +5,26 @@ We really appreciate and value contributions to OpenZeppelin. Please take 5' to ## Contribution guidelines -Smart contracts manage value and are highly vulnerable to errors and attacks. We have very strict guidelines, please make sure to review them: ["Contribution guidelines wiki entry"](https://github.com/OpenZeppelin/zeppelin-solidity/wiki/Contribution-guidelines). +Smart contracts manage value and are highly vulnerable to errors and attacks. We have very strict guidelines, please make sure to review them: ["Contribution guidelines wiki entry"](https://github.com/OpenZeppelin/openzeppelin-solidity/wiki/Contribution-guidelines). ## Creating Pull Requests (PRs) As a contributor, you are expected to fork this repository, work on your own fork and then submit pull requests. The pull requests will be reviewed and eventually merged into the main repo. See ["Fork-a-Repo"](https://help.github.com/articles/fork-a-repo/) for how this works. *IMPORTANT* -* Please see ["Git flow wiki entry"](https://github.com/OpenZeppelin/zeppelin-solidity/wiki/Git-flow) for understanding how to use branches in this repository. +* Please see ["Git flow wiki entry"](https://github.com/OpenZeppelin/openzeppelin-solidity/wiki/Git-flow) for understanding how to use branches in this repository. ## A typical workflow 1) Make sure your fork is up to date with the main repository: ``` -cd zeppelin-solidity +cd openzeppelin-solidity git fetch upstream git checkout development git pull --rebase upstream development ``` -NOTE: The directory `zeppelin-solidity` represents your fork's local copy. +NOTE: The directory `openzeppelin-solidity` represents your fork's local copy. 2) Branch out from `development` into `fix/some-bug-#123`: (Postfixing #123 will associate your PR with the issue #123 and make everyone's life easier =D) @@ -40,7 +40,7 @@ git commit "Fix some bug #123" git push origin fix/some-bug-#123 ``` -4) Go to [github.com/OpenZeppelin/zeppelin-solidity](https://github.com/OpenZeppelin/zeppelin-solidity) in your web browser and issue a new pull request. +4) Go to [github.com/OpenZeppelin/openzeppelin-solidity](https://github.com/OpenZeppelin/zeppelin-solidity) in your web browser and issue a new pull request. *IMPORTANT* Read the PR template very carefully and make sure to follow all the instructions. These instructions refer to some very important conditions that your PR must meet in order to be accepted, such as making sure that all tests pass, JS linting tests pass, solidity linting tests pass, etc. @@ -51,8 +51,8 @@ refer to some very important conditions that your PR must meet in order to be ac ## All set! -If you have any questions feel free to post them to github.com/OpenZeppelin/zeppelin-solidity/issues. +If you have any questions feel free to post them to github.com/OpenZeppelin/openzeppelin-solidity/issues. -Finally, if you're looking to collaborate and want to find easy tasks to start, look at the issues we marked as ["Good first issue"](https://github.com/OpenZeppelin/zeppelin-solidity/labels/good%20first%20issue). +Finally, if you're looking to collaborate and want to find easy tasks to start, look at the issues we marked as ["Good first issue"](https://github.com/OpenZeppelin/openzeppelin-solidity/labels/good%20first%20issue). Thanks for your time and code! diff --git a/README.md b/README.md index dffccfe6a..f4c99ff8a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Zeppelin Solidity -[![NPM Package](https://img.shields.io/npm/v/zeppelin-solidity.svg?style=flat-square)](https://www.npmjs.org/package/zeppelin-solidity) -[![Build Status](https://img.shields.io/travis/OpenZeppelin/zeppelin-solidity.svg?branch=master&style=flat-square)](https://travis-ci.org/OpenZeppelin/zeppelin-solidity) -[![Coverage Status](https://img.shields.io/coveralls/github/OpenZeppelin/zeppelin-solidity/master.svg?style=flat-square)](https://coveralls.io/github/OpenZeppelin/zeppelin-solidity?branch=master) +# OpenZeppelin Solidity +[![NPM Package](https://img.shields.io/npm/v/openzeppelin-solidity.svg?style=flat-square)](https://www.npmjs.org/package/openzeppelin-solidity) +[![Build Status](https://img.shields.io/travis/OpenZeppelin/openzeppelin-solidity.svg?branch=master&style=flat-square)](https://travis-ci.org/OpenZeppelin/openzeppelin-solidity) +[![Coverage Status](https://img.shields.io/coveralls/github/OpenZeppelin/openzeppelin-solidity/master.svg?style=flat-square)](https://coveralls.io/github/OpenZeppelin/openzeppelin-solidity?branch=master) OpenZeppelin is a library for writing secure [Smart Contracts](https://en.wikipedia.org/wiki/Smart_contract) on Ethereum. @@ -24,15 +24,15 @@ truffle init To install the OpenZeppelin library, run the following in your Solidity project root directory: ```sh npm init -y -npm install -E zeppelin-solidity +npm install -E openzeppelin-solidity ``` **Note that OpenZeppelin does not currently follow semantic versioning.** You may encounter breaking changes upon a minor version bump. We recommend pinning the version of OpenZeppelin you use, as done by the `-E` (`--save-exact`) option. -After that, you'll get all the library's contracts in the `node_modules/zeppelin-solidity/contracts` folder. You can use the contracts in the library like so: +After that, you'll get all the library's contracts in the `node_modules/openzeppelin-solidity/contracts` folder. You can use the contracts in the library like so: ```solidity -import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; +import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; contract MyContract is Ownable { ... @@ -56,9 +56,9 @@ Building a distributed application, protocol or organization with OpenZeppelin? Interested in contributing to OpenZeppelin? - Framework proposal and roadmap: https://medium.com/zeppelin-blog/zeppelin-framework-proposal-and-development-roadmap-fdfa9a3a32ab#.iain47pak -- Issue tracker: https://github.com/OpenZeppelin/zeppelin-solidity/issues -- Contribution guidelines: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/CONTRIBUTING.md -- Wiki: https://github.com/OpenZeppelin/zeppelin-solidity/wiki +- Issue tracker: https://github.com/OpenZeppelin/openzeppelin-solidity/issues +- Contribution guidelines: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/CONTRIBUTING.md +- Wiki: https://github.com/OpenZeppelin/openzeppelin-solidity/wiki ## License -Code released under the [MIT License](https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/LICENSE). +Code released under the [MIT License](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE). diff --git a/contracts/lifecycle/Migrations.sol b/contracts/lifecycle/Migrations.sol deleted file mode 100644 index caf1fd56b..000000000 --- a/contracts/lifecycle/Migrations.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.4.21; - -import "../ownership/Ownable.sol"; - - -/** - * @title Migrations - * @dev This is a truffle contract, needed for truffle integration, not meant for use by Zeppelin users. - */ -contract Migrations is Ownable { - uint256 public lastCompletedMigration; - - function Migrations() public { - Ownable.initialize(msg.sender); - } - - function setCompleted(uint256 completed) onlyOwner public { - lastCompletedMigration = completed; - } - - function upgrade(address newAddress) onlyOwner public { - Migrations upgraded = Migrations(newAddress); - upgraded.setCompleted(lastCompletedMigration); - } -} diff --git a/contracts/token/ERC20/BasicToken.sol b/contracts/token/ERC20/BasicToken.sol index bdcf58c9d..905128fa2 100644 --- a/contracts/token/ERC20/BasicToken.sol +++ b/contracts/token/ERC20/BasicToken.sol @@ -43,7 +43,7 @@ contract BasicToken is ERC20Basic { * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ - function balanceOf(address _owner) public view returns (uint256 balance) { + function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } diff --git a/contracts/token/ERC20/MintableToken.sol b/contracts/token/ERC20/MintableToken.sol index 36d24587a..97ddc6666 100644 --- a/contracts/token/ERC20/MintableToken.sol +++ b/contracts/token/ERC20/MintableToken.sol @@ -7,7 +7,7 @@ import "zos-lib/contracts/migrations/Migratable.sol"; /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation - * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 + * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is Migratable, Ownable, StandardToken { diff --git a/ethpm.json b/ethpm.json index 5c6e9bd82..807438c3a 100644 --- a/ethpm.json +++ b/ethpm.json @@ -1,6 +1,6 @@ { "package_name": "zeppelin", - "version": "1.8.0", + "version": "1.9.0", "description": "Secure Smart Contract library for Solidity", "authors": [ "Manuel Araoz " diff --git a/migrations/.gitkeep b/migrations/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/migrations/1_initial_migration.js b/migrations/1_initial_migration.js deleted file mode 100644 index fbe302cd4..000000000 --- a/migrations/1_initial_migration.js +++ /dev/null @@ -1,5 +0,0 @@ -var Migrations = artifacts.require('Migrations'); - -module.exports = function (deployer) { - deployer.deploy(Migrations); -}; diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js deleted file mode 100644 index a79df71b6..000000000 --- a/migrations/2_deploy_contracts.js +++ /dev/null @@ -1,9 +0,0 @@ -// var Ownable = artifacts.require("Ownable"); - -// NOTE: Use this file to easily deploy the contracts you're writing. -// (but make sure to reset this file before committing -// with `git checkout HEAD -- migrations/2_deploy_contracts.js`) - -module.exports = function (deployer) { - // deployer.deploy(Ownable); -}; diff --git a/package-lock.json b/package-lock.json index fafb40d16..5f99b3728 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "openzeppelin-zos", - "version": "1.9.0-beta", + "version": "1.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2101,7 +2101,8 @@ "dotenv": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz", - "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=" + "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=", + "dev": true }, "drbg.js": { "version": "1.0.1", @@ -6149,12 +6150,6 @@ } } }, - "mocha-lcov-reporter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz", - "integrity": "sha1-Rpve9PivyaEWBW8HnfYYLQr7A4Q=", - "dev": true - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", diff --git a/package.json b/package.json index c1a6f6f59..a1b6a691a 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "openzeppelin-zos", - "version": "1.9.0-beta", + "version": "1.9.0", "description": "Secure Smart Contract library for Solidity", "files": [ "contracts", - "build" + "build", + "test" ], "scripts": { "prepack": "truffle compile", @@ -16,7 +17,8 @@ "lint:all": "npm run lint && npm run lint:sol", "lint:all:fix": "npm run lint:fix && npm run lint:sol:fix", "console": "truffle console", - "coverage": "scripts/coverage.sh" + "coverage": "scripts/coverage.sh", + "version": "scripts/version.js" }, "repository": { "type": "git", @@ -46,6 +48,7 @@ "chai-as-promised": "^7.0.0", "chai-bignumber": "^2.0.0", "coveralls": "^2.13.1", + "dotenv": "^4.0.0", "eslint": "^4.11.0", "eslint-config-standard": "^10.2.1", "eslint-plugin-import": "^2.8.0", @@ -55,7 +58,6 @@ "ethereumjs-util": "^5.1.2", "ethjs-abi": "^0.2.1", "ganache-cli": "6.1.0", - "mocha-lcov-reporter": "^1.3.0", "solidity-coverage": "^0.4.15", "solium": "^1.1.6", "truffle": "^4.1.5", diff --git a/scripts/version.js b/scripts/version.js new file mode 100755 index 000000000..1fcc07354 --- /dev/null +++ b/scripts/version.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +// Synchronizes ethpm.json version number with package.json. +// Useful to run as an npm script alogn with `npm version`. + +const fs = require('fs'); +const cp = require('child_process'); + +const pkg = require('../package.json'); +const ethpm = require('../ethpm.json'); + +ethpm.version = pkg.version; + +fs.writeFileSync('ethpm.json', JSON.stringify(ethpm, null, 2) + '\n'); + +cp.execSync('git add ethpm.json'); diff --git a/test/token/ERC721/ERC721Token.test.js b/test/token/ERC721/ERC721Token.test.js index a1aabc241..46e0cfc68 100644 --- a/test/token/ERC721/ERC721Token.test.js +++ b/test/token/ERC721/ERC721Token.test.js @@ -80,13 +80,13 @@ contract('ERC721Token', function (accounts) { const sampleUri = 'mock://mytoken'; it('has a name', async function () { - const name = await this.token.name(); - name.should.be.equal(name); + const tokenName = await this.token.name(); + tokenName.should.be.equal(name); }); it('has a symbol', async function () { - const symbol = await this.token.symbol(); - symbol.should.be.equal(symbol); + const tokenSymbol = await this.token.symbol(); + tokenSymbol.should.be.equal(symbol); }); it('sets and returns metadata for a token id', async function () {