-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df693a8
commit f0b3a08
Showing
30 changed files
with
1,630 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.json | ||
*.sol | ||
*.log |
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,7 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"solidity.formatter": "forge", | ||
"[solidity]": { | ||
"editor.defaultFormatter": "NomicFoundation.hardhat-solidity" | ||
} | ||
} |
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,142 @@ | ||
/** | ||
* GemForge configuration file. | ||
* | ||
* For detailed instructions please see the documentation at https://gemforge.xyz/configuration/ | ||
*/ | ||
module.exports = { | ||
// Configuration file version | ||
version: 2, | ||
// Compiler configuration | ||
solc: { | ||
// SPDX License - to be inserted in all generated .sol files | ||
license: 'MIT', | ||
// Solidity compiler version - to be inserted in all generated .sol files | ||
version: '0.8.21', | ||
}, | ||
// commands to execute | ||
commands: { | ||
// the build command | ||
build: 'forge build', | ||
}, | ||
paths: { | ||
// contract built artifacts folder | ||
artifacts: 'out', | ||
// source files | ||
src: { | ||
// file patterns to include in facet parsing | ||
facets: [ | ||
// include all .sol files in the facets directory ending "Facet" | ||
'src/facets/*Facet.sol' | ||
], | ||
}, | ||
// folders for gemforge-generated files | ||
generated: { | ||
// output folder for generated .sol files | ||
solidity: 'src/generated', | ||
// output folder for support scripts and files | ||
support: '.gemforge', | ||
// deployments JSON file | ||
deployments: 'gemforge.deployments.json', | ||
}, | ||
// library source code | ||
lib: { | ||
// diamond library | ||
diamond: 'lib/diamond-2-hardhat', | ||
} | ||
}, | ||
// artifacts configuration | ||
artifacts: { | ||
// artifact format - "foundry" or "hardhat" | ||
format: 'foundry', | ||
}, | ||
// generator options | ||
generator: { | ||
// proxy interface options | ||
proxyInterface: { | ||
// imports to include in the generated IDiamondProxy interface | ||
imports: [], | ||
}, | ||
}, | ||
// diamond configuration | ||
diamond: { | ||
// Whether to include public methods when generating the IDiamondProxy interface. Default is to only include external methods. | ||
publicMethods: false, | ||
// Names of core facet contracts - these will not be modified/removed once deployed. | ||
// This default list is based on the diamond-2-hardhat library. | ||
// NOTE: WE RECOMMEND NOT CHANGING ANY OF THESE EXISTING NAMES UNLESS YOU KNOW WHAT YOU ARE DOING. | ||
coreFacets: [ | ||
'OwnershipFacet', | ||
'DiamondCutFacet', | ||
'DiamondLoupeFacet', | ||
], | ||
}, | ||
// lifecycle hooks | ||
hooks: { | ||
// shell command to execute before build | ||
preBuild: '', | ||
// shell command to execute after build | ||
postBuild: '', | ||
// shell command to execute before deploy | ||
preDeploy: '', | ||
// shell command to execute after deploy | ||
postDeploy: '', | ||
}, | ||
// Wallets to use for deployment | ||
wallets: { | ||
// Wallet named "wallet1" | ||
wallet1: { | ||
// Wallet type - mnemonic | ||
type: 'mnemonic', | ||
// Wallet config | ||
config: { | ||
// Mnemonic phrase | ||
words: 'test test test test test test test test test test test junk', | ||
// 0-based index of the account to use | ||
index: 0, | ||
} | ||
}, | ||
wallet2: { | ||
// Wallet type - mnemonic | ||
type: 'mnemonic', | ||
// Wallet config | ||
config: { | ||
// Mnemonic phrase | ||
words: () => process.env.MNEMONIC, | ||
// 0-based index of the account to use | ||
index: 0, | ||
}, | ||
}, | ||
}, | ||
// Networks/chains | ||
networks: { | ||
// Local network | ||
local: { | ||
// RPC endpoint URL | ||
rpcUrl: 'http://localhost:8545', | ||
}, | ||
// Sepolia test network | ||
sepolia: { | ||
// RPC endpoint URL | ||
rpcUrl: () => process.env.SEPOLIA_RPC_URL, | ||
} | ||
}, | ||
// Targets to deploy | ||
targets: { | ||
local: { | ||
// Network to deploy to | ||
network: 'local', | ||
// Wallet to use for deployment | ||
wallet: 'wallet1', | ||
// Initialization function arguments | ||
initArgs: [], | ||
}, | ||
testnet: { | ||
// Network to deploy to | ||
network: 'sepolia', | ||
// Wallet to use for deployment | ||
wallet: 'wallet2', | ||
// Initialization function arguments | ||
initArgs: [], | ||
} | ||
} | ||
} |
Submodule diamond-2-hardhat
added at
c455af
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,8 @@ | ||
forge-std/=lib/forge-std/src/ | ||
openzeppelin/=lib/openzeppelin-contracts/contracts/ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ | ||
diamond-2-hardhat/=lib/diamond-2-hardhat/contracts/ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/ | ||
openzeppelin-contracts/=lib/openzeppelin-contracts/ | ||
solady/=lib/solady/src/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import { LibACL } from "../libs/LibACL.sol"; | ||
import { Modifiers } from "../shared/Modifiers.sol"; | ||
|
||
/** | ||
* @title Access Control List | ||
* @notice Use it to authorize various actions on the contracts | ||
* @dev Use it to (un)assign or check role membership | ||
*/ | ||
contract ACLFacet is Modifiers { | ||
function setSystemAdmin(address _newSystemAdmin) external onlySysAdmin { | ||
LibACL._setSystemAdmin(_newSystemAdmin); | ||
} | ||
|
||
function setMinter(address _newMinter) external onlySysAdmin { | ||
LibACL._setMinter(_newMinter); | ||
} | ||
|
||
function removeSysAdmin(address _removeSystemAdmin) external onlySysAdmin { | ||
LibACL._removeSystemAdmin(_removeSystemAdmin); | ||
} | ||
} |
Oops, something went wrong.