-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 refactor ERC721STD, script to generate data for STS dep
- Loading branch information
Showing
3 changed files
with
57 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as fs from 'fs'; | ||
const hre = require("hardhat"); | ||
|
||
async function main(){ | ||
|
||
const contractPath = "contracts/package/tokens/" | ||
const contractName = "ERC721STD" | ||
|
||
const sourceJSON = await hre.run("verify:etherscan-get-minimal-input", { | ||
sourceName: `${contractPath}${contractName}.sol`, | ||
}) | ||
|
||
let contractMeta = { | ||
// title to show on STS | ||
title: "ERC721", | ||
// contract NAME | ||
name: contractName, | ||
verificationName: `${contractPath}${contractName}.sol:${contractName}`, | ||
git: "https://github.com/AlphaWallet/stl-contracts/blob/main/contracts/package/tokens/ERC721STD.sol", | ||
description: "This ERC721 implementation is Mintable, Burnable, Enumerable, use AccessControl, has Metadata control, can change ContractURI, supports ERC5169", | ||
compiler: "v0.8.20+commit.a1b79de6", | ||
codeformat: "solidity-standard-json-input", | ||
// uncomment next line to disable this contract | ||
// disabled: false, | ||
// "0" or "1" | ||
optimizationused: "1", | ||
runs: "200", | ||
content: sourceJSON | ||
} | ||
|
||
const contractJSONData = await fs.promises.readFile(`artifacts/${contractPath}/${contractName}.sol/${contractName}.json`, 'utf8'); | ||
const contractJSON = JSON.parse(contractJSONData) | ||
|
||
contractMeta = Object.assign(contractMeta, contractJSON) | ||
|
||
await fs.promises.writeFile(`./${contractName}.json`, JSON.stringify([contractMeta])); | ||
} | ||
main() | ||
|