OpenZeppelin / contracts-wizard

Interactive smart contract generator based on OpenZeppelin Contracts.
https://wizard.openzeppelin.com
MIT License
245 stars 135 forks source link

Enable prefilling initial options from URL search parameters #380

Closed ericglau closed 2 weeks ago

ericglau commented 2 weeks ago

Enables the name, symbol, and premint options to be prefilled from URL search parameters.

Previously the string content after # in the URL was treated as the tab (e.g. erc20 or erc721)

With this PR, it splits that string content into further fragments, where a fragment can be just the tab as before, or fragments can be additional key=value pairs.

For example: https://wizard.openzeppelin.com/cairo#erc721&name=MyContractName would go to the Cairo language with tab=erc721 and name=MyContractName

ericglau commented 2 weeks ago

Examples from preview build: https://deploy-preview-380--openzeppelin-contracts-wizard.netlify.app/#erc721&name=MyNFT https://deploy-preview-380--openzeppelin-contracts-wizard.netlify.app/cairo#erc1155&name=My1155Contract