-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add minimal fe support * fix: fix tests for fe module * chore: fmt * chore: attempt to install fe on workflow * fix: add url to curl command * fix: fix curl command * Invariant testing base contract * Complete invariants module and add bound function from forge-std * forge fmt * chore: use fe v0.24.0 * docs: add docs for the `Fe` module. * chore: export `fe` from `script.sol` * chore: export `Fe` struct from `script.sol` * chore: export huff from script.sol * fix: fix Fe module import on script.sol * feat: add method to create multiple addresses * chore: rename method * empty * Add invariant functions that receive arrays * Add docs * Add docs * Format * Fix docs * fix: fix Fe module documentation * fix: json safe create and improve accounts * feat: use tryFfi on commands (#136) * feat: use tryFfi on commands * style: fmt * feat: use CommandResult instead of FfiResult * chore: remove Hevm copy and replace with ad hoc interface * chore: extend CommandResult * chore: update function names * chore: use unwrap/expect as function names * style: fmt * test: improve unwrap test * style: fmt * docs: update commands docs (#142) * docs: update commands docs * docs: add expect example * chore: remove console unused imports * chore: update unwrap error format (#145) * chore: make output dir optional when building Fe code (#149) * chore: add `rawConsoleLog` function (#152) * feat: add `rawConsoleLog` function Add a `rawConsoleLog` function to prevent compiling the whole `console` contract from `forge-std`. Resolves #120 * chore: use println instead of rawConsoleLog * feat: adds createMay(length, prefix) (#150) Adds a new function to the `accounts` module `createMany(length, prefix)` that creates an array of addresses of a specified length and applies a label to each one with a prefix `prefix` in the form of `{prefix}_{i}`. * chore: add formatError function (#153) * chore: add `formatError` function add `formatError` function to standardize Vulcan error messages. Resolves #105 * chore: add formatError to accounts * chore: progress adding formatError to modules * chore: add formatError to fmt * chore: add formatError to missing modules * chore: update forge-std to commit 1d9650e (#157) * chore: remove TryFfi interface (#159) Removes the `TryFfi` interface and uses the `forge-std` `Vm` `tryFfi` method directly. * docs: update vulcan version to 0.3.0 * docs: update installation guide vulcan version * chore(main): release 0.3.0 * chore: setup husky and commitlint (#161) --------- Co-authored-by: Vicente Dragicevic <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
658e96f
commit a846bee
Showing
43 changed files
with
3,234 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,9 @@ out/ | |
.env | ||
|
||
.DS_Store | ||
|
||
# Test stuff | ||
test/fixtures/fe | ||
|
||
# Node stuff | ||
node_modules |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit ${1} |
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,16 @@ | ||
# Changelog | ||
|
||
## [0.3.0](https://github.com/nomoixyz/vulcan/compare/v0.2.0...v0.3.0) (2023-09-01) | ||
|
||
|
||
### Features | ||
|
||
* add function to create empty command ([2c31886](https://github.com/nomoixyz/vulcan/commit/2c31886075fae5a5177410739309ff38ed834f2a)) | ||
* export Command struct from script.sol ([c88883a](https://github.com/nomoixyz/vulcan/commit/c88883a402ccfae6aa2d0de674936ba22e3d3514)) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* fix return natspect documentation ([5da4ad1](https://github.com/nomoixyz/vulcan/commit/5da4ad14fbe07b35d29260fe2cb97ffb2cb95de3)) | ||
* tabs ([1d4c0b9](https://github.com/nomoixyz/vulcan/commit/1d4c0b9d350445825d84198c7b242f5e432ffb39)) | ||
* update code examples ([953d661](https://github.com/nomoixyz/vulcan/commit/953d661e1a84e84b9a40b8f8178980ea32d0ef96)) |
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 @@ | ||
module.exports = {extends: ['@commitlint/config-conventional']} |
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
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,25 @@ | ||
# Fe | ||
|
||
Provides [Fe](https://fe-lang.org/) compiler support. The `ffi` setting must be enabled on `foundry.toml` for this module | ||
to work. | ||
|
||
```solidity | ||
import { Test, fe } from "vulcan/test.sol"; | ||
contract TestMyContract is Test { | ||
function testCompile() external { | ||
fe | ||
.create() | ||
.setFilePath("./test/mocks/guest_book.fe") | ||
.setOutputDir("./test/fixtures/fe/output") | ||
.setOverwrite(true) | ||
.build() | ||
.unwrap(); | ||
bytes memory bytecode = fe.getBytecode("GuestBook"); | ||
} | ||
} | ||
``` | ||
[**Fe API reference**](../reference/modules/fe.md) | ||
|
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,45 @@ | ||
# Fe | ||
|
||
#### **`create() → (Fe)`** | ||
|
||
Creates a new `Fe` struct with the following defaults. | ||
|
||
```solidity | ||
Fe({ | ||
compilerPath: "fe", | ||
filePath: "", | ||
outputDir: "", | ||
overwrite: false | ||
}); | ||
``` | ||
|
||
> Notice: The `filePath` is the only required field, if it is empty, `.build` and `.toCommand` | ||
> will revert. | ||
#### **`build(Fe self) → (bytes)`** | ||
|
||
Builds a binary file from a `.fe` file. | ||
|
||
#### **`toCommand(Fe self) → (Command)`** | ||
|
||
Converts the `Fe` struct into a `Command` struct. | ||
|
||
#### **`setCompilerPath(Fe self, string compilerPath) → (Fe)`** | ||
|
||
Overwrites the compiler path. | ||
|
||
#### **`setFilePath(Fe self, string filePath) → (Fe)`** | ||
|
||
Overwrites the file path. | ||
|
||
#### **`setOutputDir(Fe self, string outputDir) → (Fe)`** | ||
|
||
Overwrites the default artifacts directory. | ||
|
||
#### **`setOverwrite(Fe memory self, bool overwrite) → (Fe)`** | ||
|
||
Sets the build command overwrite flag. If `true` the contents of `outputDir` will be overwritten. | ||
|
||
#### **`getBytecode(Fe memory self, string contractName) → (bytes)`** | ||
|
||
Returns the bytecode from a compiled `Fe` contract. |
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,73 @@ | ||
# Invariants | ||
|
||
```solidity | ||
struct FuzzSelector { | ||
address addr; | ||
bytes4[] selectors; | ||
} | ||
``` | ||
|
||
#### **`excludeContract(address newExcludedContract)`** | ||
|
||
Excludes a contract from the invariant runs. This means that no transactions will be sent to this contract. | ||
|
||
#### **`excludeContracts(address[] memory newExcludedContracts)`** | ||
|
||
Excludes multiple contracts from the invariant runs. This means that no transactions will be sent to these contracts. | ||
|
||
#### **`excludeSender(address newExcludedSender)`** | ||
|
||
Excludes a sender from the invariant runs. This means that the address will not be used as the sender of a transaction. | ||
|
||
#### **`excludeSenders(address[] memory newExcludedSenders)`** | ||
|
||
Excludes multiple senders from the invariant runs. This means that these addresses will not be used as the senders of transactions. | ||
|
||
#### **`excludeArtifact(string memory newExcludedArtifact)`** | ||
|
||
Excludes an artifact from the invariant runs. This means that contracts with this artifact will not be targeted. | ||
|
||
#### **`excludeArtifacts(string[] memory newExcludedArtifacts)`** | ||
|
||
Excludes multiple artifacts from the invariant runs. This means that contracts with these artifacts will not be targeted. | ||
|
||
#### **`targetArtifact(string memory newTargetedArtifact)`** | ||
|
||
Targets an artifact in the invariant runs. This means that contracts with this artifact will be specifically targeted. | ||
|
||
#### **`targetArtifacts(string[] memory newTargetedArtifacts)`** | ||
|
||
Targets multiple artifacts in the invariant runs. This means that contracts with these artifacts will be specifically targeted. | ||
|
||
#### **`targetArtifactSelector(FuzzSelector memory newTargetedArtifactSelector)`** | ||
|
||
Targets an artifact selector in the invariant runs. This means that the specific artifact selector will be targeted. | ||
|
||
#### **`targetArtifactSelectors(FuzzSelector[] memory newTargetedArtifactSelectors)`** | ||
|
||
Targets multiple artifact selectors in the invariant runs. This means that these specific artifact selectors will be targeted. | ||
|
||
#### **`targetContract(address newTargetedContract)`** | ||
|
||
Targets a contract in the invariant runs. This means that transactions will be specifically sent to this contract. | ||
|
||
#### **`targetContracts(address[] memory newTargetedContracts)`** | ||
|
||
Targets multiple contracts in the invariant runs. This means that transactions will be specifically sent to these contracts. | ||
|
||
#### **`targetSelector(FuzzSelector memory newTargetedSelector)`** | ||
|
||
Targets a selector in the invariant runs. This means that the specific selector will be targeted. | ||
|
||
#### **`targetSelectors(FuzzSelector[] memory newTargetedSelectors)`** | ||
|
||
Targets multiple selectors in the invariant runs. This means that these specific selectors will be targeted. | ||
|
||
#### **`targetSender(address newTargetedSender)`** | ||
|
||
Targets a sender in the invariant runs. This means that the address will be specifically used as the sender of a transaction. | ||
|
||
#### **`targetSenders(address[] memory newTargetedSenders)`** | ||
|
||
Targets multiple senders in the invariant runs. This means that these addresses will be specifically used as the senders of transactions. | ||
|
Oops, something went wrong.