GithubHelp home page GithubHelp logo

Comments (6)

Vectorized avatar Vectorized commented on August 26, 2024 1

Probably will look into some workflow that can run a script to do this some time after next version.

I suggest either a shell script (e.g. scripts/replace-contract-versions.sh), or js snippet (e.g. scripts/replace-contract-versions.js) that can read from package.json and update the files in contracts.

For an example, see https://github.com/Vectorized/ERC721A-Upgradeable/

If anyone wants to make the script and/or workflow file, feel free to open a PR.

from erc721a.

ahbanavi avatar ahbanavi commented on August 26, 2024 1

It would be nice to have this version stamp as well for contract review.

@Austinhs Exactly, that was my main intention for raising this issue.

from erc721a.

Vectorized avatar Vectorized commented on August 26, 2024 1

@ahbanavi Make a PR.

My 2 cents:

While OZ only updates the version in the updated files, I think having the same version number across all files has the advantage that it is easy to know two files are meant for each other. For example #214 was caused by the files being from different versions.

Also, it is simpler to just replace the version number in all the .sol files.

from erc721a.

ahbanavi avatar ahbanavi commented on August 26, 2024

@cygaar please consider this for next version release, I'm waiting to hear your thoughts before closing this issue.

from erc721a.

Austinhs avatar Austinhs commented on August 26, 2024

Just to add to the argument - It would be nice to have this version stamp as well for contract review. It's really different when you are reviewing someone with v1 instead of v2, would save a lot of time on parsing the contract to try and figure out when did they copy/install the ERC721A contract

from erc721a.

ahbanavi avatar ahbanavi commented on August 26, 2024

I suggest either a shell script (e.g. scripts/replace-contract-versions.sh), or js snippet (e.g. scripts/replace-contract-versions.js) that can read from package.json and update the files in contracts.

I'm working on a script to change the package.json version and comments simultaneously, so maintainers could just update all files on bump version PR, like #179 #39

I'm using this issue to discuss the implementation of this.

you can see the script here at scripts/release/update-version.js
the usage is as simple as:

./scripts/release/update-version.js 3.2.0

or even use it as:

npm run update-version 3.2.0

And then, the package.json version and all other files will update.
The header of all .sol files will look like this:

// SPDX-License-Identifier: MIT
// ERC721A Contracts v3.2.0
// Creator: Chiru Labs

We can also ignore the mocks, but adding a version comment will not do any harm, IMO.

I would like to mention that this script will update all files, apart from whether they have been modified since the last tag version.
We can update just modified files using git, like the OZ implementation of this script. See here

Probably will look into some workflow

I don't like changing source code and committing it to the main branch in the workflow; problems may occur. Using this script manually is okay, IMO.

I'm waiting to hear your thoughts on this implementation before opening a PR.
@cygaar @Vectorized

from erc721a.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.