Skip to content

Commit

Permalink
Merge pull request #16 from 1inch/feature/update-doc-generator
Browse files Browse the repository at this point in the history
[SC-1287] Remove deprecated script for docgen
  • Loading branch information
zZoMROT authored Nov 14, 2024
2 parents c581a8f + 7d6ea7d commit 56fbd12
Show file tree
Hide file tree
Showing 12 changed files with 1,945 additions and 1,034 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20

- run: npm install -g yarn
shell: bash
Expand Down
40 changes: 0 additions & 40 deletions docgen/docs/Example.md

This file was deleted.

1 change: 0 additions & 1 deletion docgen/docs/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions docgen/docs/SUMMARY.md

This file was deleted.

102 changes: 102 additions & 0 deletions docs/AddressToken.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@

## AddressToken

### Functions list
- [constructor(_metadataContract, owner) public](#constructor)
- [addressForTokenId(tokenId) external](#addressfortokenid)
- [tokenURI(tokenId) public](#tokenuri)
- [tokenJSON(tokenId) public](#tokenjson)
- [getTokenIdAndSalt(magic, account) public](#gettokenidandsalt)
- [mint(magic) external](#mint)
- [mintFor(magic, account) public](#mintfor)
- [deploy(tokenId, creationCode) public](#deploy)
- [deployAndCalls(tokenId, creationCode, cds) external](#deployandcalls)
- [upgradeMetadataContract(_metadataContract) external](#upgrademetadatacontract)

### Errors list
- [AccessDenied() ](#accessdenied)
- [RemintForbidden() ](#remintforbidden)
- [CallReverted(, ) ](#callreverted)

### Functions
### constructor

```solidity
constructor(contract IAddressTokenMetadata _metadataContract, address owner) public
```

### addressForTokenId

```solidity
function addressForTokenId(uint256 tokenId) external pure returns (address)
```

### tokenURI

```solidity
function tokenURI(uint256 tokenId) public view returns (string)
```

_See {IERC721Metadata-tokenURI}._

### tokenJSON

```solidity
function tokenJSON(uint256 tokenId) public view returns (string)
```

### getTokenIdAndSalt

```solidity
function getTokenIdAndSalt(bytes16 magic, address account) public view returns (address tokenId, bytes32 salt)
```

### mint

```solidity
function mint(bytes16 magic) external returns (address tokenId)
```

### mintFor

```solidity
function mintFor(bytes16 magic, address account) public returns (address tokenId)
```

### deploy

```solidity
function deploy(address tokenId, bytes creationCode) public payable returns (address deployed)
```

### deployAndCalls

```solidity
function deployAndCalls(address tokenId, bytes creationCode, bytes[] cds) external payable returns (address deployed)
```

### upgradeMetadataContract

```solidity
function upgradeMetadataContract(contract IAddressTokenMetadata _metadataContract) external
```

### Errors
### AccessDenied

```solidity
error AccessDenied()
```

### RemintForbidden

```solidity
error RemintForbidden()
```

### CallReverted

```solidity
error CallReverted(uint256, bytes)
```

13 changes: 13 additions & 0 deletions docs/AddressTokenMetadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

## AddressTokenMetadata

### Functions list
- [tokenJSON(tokenId) external](#tokenjson)

### Functions
### tokenJSON

```solidity
function tokenJSON(uint256 tokenId) external pure returns (string)
```

13 changes: 13 additions & 0 deletions docs/interfaces/IAddressTokenMetadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

## IAddressTokenMetadata

### Functions list
- [tokenJSON(tokenId) external](#tokenjson)

### Functions
### tokenJSON

```solidity
function tokenJSON(uint256 tokenId) external pure returns (string)
```

18 changes: 11 additions & 7 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
require('@nomiclabs/hardhat-ethers');
require('@nomiclabs/hardhat-etherscan');
require('@nomicfoundation/hardhat-ethers');
require('@nomicfoundation/hardhat-chai-matchers');
require('dotenv').config();
require('hardhat-dependency-compiler');
require('hardhat-deploy');
require('hardhat-gas-reporter');
require('hardhat-tracer');
require('solidity-coverage');
require('solidity-docgen');

const { networks, etherscan } = require('./hardhat.networks');
const { oneInchTemplates } = require('@1inch/solidity-utils/docgen');
const { Networks, getNetwork } = require('@1inch/solidity-utils/hardhat-setup');

function getNetwork () {
const index = process.argv.findIndex((arg) => arg === '--network') + 1;
return index !== 0 ? process.argv[index] : undefined;
}
const { networks, etherscan } = (new Networks()).registerAll();

module.exports = {
etherscan,
Expand Down Expand Up @@ -44,4 +42,10 @@ module.exports = {
dependencyCompiler: {
paths: [],
},
docgen: {
outputDir: 'docs',
templates: oneInchTemplates(),
pages: 'files',
exclude: ['mocks'],
},
};
55 changes: 0 additions & 55 deletions hardhat.networks.js

This file was deleted.

43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,39 @@
},
"license": "MIT",
"dependencies": {
"@openzeppelin/contracts": "5.0.0",
"@openzeppelin/contracts": "5.1.0",
"solmate": "6.7.0"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "1.0.6",
"@nomicfoundation/hardhat-network-helpers": "1.0.8",
"@nomiclabs/hardhat-ethers": "2.2.3",
"@nomiclabs/hardhat-etherscan": "3.1.7",
"chai": "4.3.7",
"dotenv": "16.1.4",
"eslint": "8.42.0",
"@1inch/solidity-utils": "6.0.0",
"@nomicfoundation/hardhat-chai-matchers": "2.0.8",
"@nomicfoundation/hardhat-network-helpers": "1.0.12",
"@nomicfoundation/hardhat-ethers": "3.0.8",
"@nomicfoundation/hardhat-verify": "2.0.11",
"chai": "4.5.0",
"dotenv": "16.4.5",
"eslint": "8.57.1",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-n": "16.0.0",
"eslint-plugin-promise": "6.1.1",
"ethers": "5.7.2",
"hardhat": "2.19.0",
"hardhat-dependency-compiler": "1.1.3",
"hardhat-deploy": "0.11.43",
"hardhat-gas-reporter": "1.0.9",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-n": "17.13.0",
"eslint-plugin-promise": "7.1.0",
"ethers": "6.13.4",
"hardhat": "2.19.5",
"hardhat-dependency-compiler": "1.2.1",
"hardhat-deploy": "0.12.4",
"hardhat-gas-reporter": "1.0.10",
"hardhat-tracer": "2.7.0",
"rimraf": "5.0.1",
"rimraf": "6.0.1",
"solc": "0.8.22",
"solhint": "4.0.0",
"solidity-coverage": "0.8.5",
"solidity-docgen": "0.5.17"
"solhint": "5.0.3",
"solidity-coverage": "0.8.13",
"solidity-docgen": "0.6.0-beta.36"
},
"scripts": {
"clean": "rimraf artifacts cache coverage coverage.json contracts/hardhat-dependency-compiler",
"coverage": "hardhat coverage",
"deploy": "hardhat deploy --network",
"docify": "npx solidity-utils-docify",
"docify": "yarn hardhat docgen",
"lint": "yarn run lint:js && yarn run lint:sol",
"lint:fix": "yarn run lint:js:fix && yarn run lint:sol:fix",
"lint:js": "eslint .",
Expand Down
Loading

0 comments on commit 56fbd12

Please sign in to comment.