-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
41 changed files
with
4,642 additions
and
107 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/openzeppelin/openzeppelin-contracts | ||
[submodule "lib/prb-math"] | ||
path = lib/prb-math | ||
url = https://github.com/PaulRBerg/prb-math |
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 |
---|---|---|
|
@@ -8,13 +8,13 @@ WORKDIR / | |
|
||
RUN git config --global user.email "[email protected]" && \ | ||
git config --global user.name "SettleMint" && \ | ||
forge init usecase --template settlemint/solidity-empty && \ | ||
forge init usecase --template settlemint/solidity-diamond-bond && \ | ||
cd usecase && \ | ||
forge build | ||
|
||
USER root | ||
|
||
FROM busybox | ||
FROM cgr.dev/chainguard/busybox:latest | ||
|
||
COPY --from=build /usecase /usecase | ||
COPY --from=build /root/.svm /usecase-svm |
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
Submodule openzeppelin-contracts
added at
dbb610
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 @@ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ | ||
@prb/test/=lib/prb-math/node_modules/@prb/test/ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/ | ||
forge-std/=lib/forge-std/src/ | ||
openzeppelin-contracts/=lib/openzeppelin-contracts/ | ||
prb-math/=lib/prb-math/src/ |
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,69 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
import "forge-std/Script.sol"; | ||
import "../src/facets/BondFacet.sol"; | ||
import "../src/facets/ERC1155Facet.sol"; | ||
import "../src/facets/DiamondCutFacet.sol"; | ||
import "../src/facets/DiamondLoupeFacet.sol"; | ||
import "../src/Diamond.sol"; | ||
import "../src/upgradeInitializers/DiamondInit.sol"; | ||
import {IDiamondCut} from "../src/interfaces/IDiamondCut.sol"; | ||
import {BondInitParams} from "../src/libraries/StructBondInit.sol"; | ||
import "../src/interfaces/IDiamond.sol"; | ||
import "../src/GenericToken.sol"; | ||
|
||
contract DeployDiamondScript is Script { | ||
function run() public { | ||
vm.startBroadcast(); | ||
address owner = msg.sender; | ||
console.log(owner); | ||
|
||
DiamondCutFacet diamondCut = new DiamondCutFacet(); | ||
address diamondCutAddress = address(diamondCut); | ||
|
||
DiamondInit diamondInit = new DiamondInit(); | ||
address diamondInitAddress = address(diamondInit); | ||
|
||
ERC1155Facet erc1155Facet = new ERC1155Facet(); | ||
address erc1155FacetAddress = address(erc1155Facet); | ||
|
||
DiamondLoupeFacet diamondLoupeFacet = new DiamondLoupeFacet(); | ||
address diamondLoupeFacetAddress = address(diamondLoupeFacet); | ||
|
||
BondFacet bondFacet = new BondFacet(); | ||
address bondFacetAddress = address(bondFacet); | ||
|
||
IDiamond.FacetCut[] memory cuts = new IDiamond.FacetCut[](3); | ||
cuts[0] = IDiamond.FacetCut({ | ||
facetAddress: erc1155FacetAddress, | ||
action: IDiamond.FacetCutAction.Add, | ||
functionSelectors: erc1155Facet.getSelectors() | ||
}); | ||
|
||
cuts[1] = IDiamond.FacetCut({ | ||
facetAddress: diamondLoupeFacetAddress, | ||
action: IDiamond.FacetCutAction.Add, | ||
functionSelectors: diamondLoupeFacet.getSelectors() | ||
}); | ||
|
||
cuts[2] = IDiamond.FacetCut({ | ||
facetAddress: bondFacetAddress, | ||
action: IDiamond.FacetCutAction.Add, | ||
functionSelectors: bondFacet.getSelectors() | ||
}); | ||
|
||
DiamondArgs memory da = DiamondArgs({ | ||
owner: owner, | ||
init: diamondInitAddress, | ||
initCalldata: abi.encodeWithSelector(bytes4(keccak256("init()"))) | ||
}); | ||
|
||
Diamond diamond = new Diamond(cuts, da); | ||
address diamondAddress = address(diamond); | ||
|
||
new GenericToken("GenericToken", "GT"); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.