-
Notifications
You must be signed in to change notification settings - Fork 50
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
10 changed files
with
93 additions
and
101 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 |
---|---|---|
@@ -1 +1 @@ | ||
GreeterTest:testSetGm() (gas: 107402) | ||
GreeterTest:testSetGm() (gas: 107432) |
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,61 @@ | ||
## Getting Started | ||
|
||
This is a guide to get you started with [refcell/femplate](https://github.com/refcell/femplate). | ||
|
||
### Installing | ||
|
||
Click [`use this template`](https://github.com/refcell/femplate/generate) to create a new repository with this repo as the initial state. | ||
|
||
Or, if your repo already exists, run: | ||
```sh | ||
forge init --template https://github.com/refcell/femplate | ||
git submodule update --init --recursive | ||
forge install | ||
``` | ||
|
||
Run `./utils/rename.sh` to rename all instances of `femplate` with the name of your project/repository. | ||
|
||
|
||
### First time with Forge/Foundry? | ||
|
||
See the official Foundry installation [instructions](https://github.com/foundry-rs/foundry/blob/master/README.md#installation). | ||
|
||
Then, install the [foundry](https://github.com/foundry-rs/foundry) toolchain installer (`foundryup`) with: | ||
```bash | ||
curl -L https://foundry.paradigm.xyz | bash | ||
``` | ||
|
||
Now that you've installed the `foundryup` binary, | ||
anytime you need to get the latest `forge` or `cast` binaries, | ||
you can run `foundryup`. | ||
|
||
So, simply execute: | ||
```bash | ||
foundryup | ||
``` | ||
|
||
🎉 Foundry is installed! 🎉 | ||
|
||
|
||
### Writing Tests with Foundry | ||
|
||
With [Foundry](https://github.com/foundry-rs/foundry), all tests are written in Solidity! 🥳 | ||
|
||
Create a test file for your contract in the `test/` directory. | ||
|
||
For example, [`src/Greeter.sol`](./src/Greeter.sol) has its test file defined in [`./test/Greeter.t.sol`](./test/Greeter.t.sol). | ||
|
||
To learn more about writing tests in Solidity for Foundry, reference Rari Capital's [solmate](https://github.com/Rari-Capital/solmate/tree/main/src/test) repository created by [@transmissions11](https://twitter.com/transmissions11). | ||
|
||
### Configure Foundry | ||
|
||
Using [foundry.toml](./foundry.toml), Foundry is easily configurable. | ||
|
||
For a full list of configuration options, see the Foundry [configuration documentation](https://github.com/foundry-rs/foundry/blob/master/config/README.md#all-options). | ||
|
||
|
||
### That's it! | ||
|
||
Now you are all set up to start building your project with femplate! | ||
|
||
Navigate back to the [Readme](./README.md) to resume your setup! |
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 forge-std
updated
42 files
Submodule solmate
updated
24 files
+296 −63 | .gas-snapshot | |
+3 −0 | README.md | |
+2 −2 | foundry.toml | |
+1 −1 | package-lock.json | |
+1 −1 | package.json | |
+4 −4 | src/auth/Auth.sol | |
+4 −4 | src/auth/Owned.sol | |
+38 −38 | src/test/Auth.t.sol | |
+6 −2 | src/test/ERC1155.t.sol | |
+4 −2 | src/test/ERC20.t.sol | |
+83 −0 | src/test/FixedPointMathLib.t.sol | |
+107 −0 | src/test/LibString.t.sol | |
+50 −0 | src/test/MerkleProofLib.t.sol | |
+5 −5 | src/test/Owned.t.sol | |
+21 −0 | src/test/SafeCastLib.t.sol | |
+60 −0 | src/test/SignedWadMath.t.sol | |
+1 −0 | src/utils/CREATE3.sol | |
+85 −52 | src/utils/FixedPointMathLib.sol | |
+56 −0 | src/utils/LibString.sol | |
+48 −0 | src/utils/MerkleProofLib.sol | |
+2 −0 | src/utils/SSTORE2.sol | |
+6 −0 | src/utils/SafeCastLib.sol | |
+4 −0 | src/utils/SafeTransferLib.sol | |
+235 −0 | src/utils/SignedWadMath.sol |
File renamed without changes
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