Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikker/svgnft
Making it slightly easier to create fully on-chain SVG-based NFTs.
https://github.com/mikker/svgnft
ethereum nft solidity
Last synced: 3 months ago
JSON representation
Making it slightly easier to create fully on-chain SVG-based NFTs.
- Host: GitHub
- URL: https://github.com/mikker/svgnft
- Owner: mikker
- Created: 2021-10-04T08:20:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-15T07:27:23.000Z (over 3 years ago)
- Last Synced: 2024-07-31T20:37:24.517Z (6 months ago)
- Topics: ethereum, nft, solidity
- Language: Solidity
- Homepage:
- Size: 98.6 KB
- Stars: 57
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-nft-onchain - Repository
README
# svgnft
A helper library for generating fully on-chain NFTs (ERC721) on Ethereum.
Being on-chain is fun!
## Example
See `example/`. Override `tokenUri` with something like:
```solidity
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
string memory name = string(abi.encodePacked("MyToken #", tokenId.toString()));
string memory description = "An example SVG-based, fully on-chain NFT";
string memory svg = '';return SVG721.metadata(name, description, svg);
}
```That's it!
## Install
Using [hardhat](https://hardhat.org).
```sh
npm install --save-dev svgnft
# or
yarn add --dev svgnft
```In your contract
```solidity
import "svgnft/contracts/SVG721.sol";
```## License
MIT
`Base64.sol` by Brecht Devos.