https://github.com/paulrberg/solplate
Simple utility for generating boilerplate Solidity contracts
https://github.com/paulrberg/solplate
boilerplate ethereum rust solidity
Last synced: about 1 year ago
JSON representation
Simple utility for generating boilerplate Solidity contracts
- Host: GitHub
- URL: https://github.com/paulrberg/solplate
- Owner: PaulRBerg
- License: mit
- Created: 2023-02-15T14:41:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T10:53:23.000Z (over 1 year ago)
- Last Synced: 2025-04-30T20:04:28.730Z (about 1 year ago)
- Topics: boilerplate, ethereum, rust, solidity
- Language: Rust
- Homepage:
- Size: 183 KB
- Stars: 36
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Solplate [![Github Actions][gha-badge]][gha] [![License: MIT][license-badge]][license]
[gha]: https://github.com/PaulRBerg/solplate/actions
[gha-badge]: https://github.com/PaulRBerg/solplate/actions/workflows/ci.yml/badge.svg
[license]: https://opensource.org/licenses/MIT
[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg
Simple utility for generating boilerplate Solidity contracts.
## Demo

## Build
You need to have Rust and Cargo installed on your machine. See the installation guide
[here](https://doc.rust-lang.org/cargo/getting-started/installation.html).
Then, clone this repo and install the CLI globally, like this:
```sh
cargo install --path .
```
## Usage
With no arguments (defaults to the latest Solidity version):
```sh
$ solplate
```
With a Solidity version passed as the first and only argument:
```sh
$ solplate "0.6.2"
```
To save the output to a Solidity file:
```sh
$ solplate "0.6.2" > src/Contract.sol
```
### With VSCode
You can add Solplate as a task in your global [`tasks.json`](https://stackoverflow.com/q/41046494/3873510) file:
```json
{
"version": "2.0.0",
"tasks": [
{
"label": "Generate Solidity Boilerplate",
"type": "shell",
"command": "solplate ${input:version}",
"presentation": {
"reveal": "never"
}
}
],
"inputs": [
{
"id": "version",
"default": "0.8.29",
"description": "Solidity version",
"type": "promptString"
}
]
}
```
To speed up your workflow, you can add a key bind for the task in `keybindings.json`, e.g.
```json
[
{
"key": "CMD+k b",
"command": "workbench.action.tasks.runTask",
"args": "Generate Solidity Boilerplate"
}
]
```
## License
This project is licensed under MIT.