nomoixyz / vulcan Goto Github PK
View Code? Open in Web Editor NEWDevelopment framework for Foundry projects
Home Page: https://nomoixyz.github.io/vulcan/
License: MIT License
Development framework for Foundry projects
Home Page: https://nomoixyz.github.io/vulcan/
License: MIT License
Add tests for the Console
namespace
We should probably prepend the module and function that is throwing the error, e.g. revert("accounts.impersonate: ...")
alice.impersonate();
// We shouldn't need to do accounts.stopImpersonate()
bob.impersonate();
Do manual and automated testing
Currently we are using selfdestruct
on the stop
functions in the Watcher
contract. selfdestruct
is deprecated so every time the Watcher
contract gets compiled a warning appears which is annoying.
We need to find a way to get the same functionality for the stop
function but without using selfdestruct
Add tests for the Strings
namespace
forge fmt
.ci
configuration to either fail if the code is not formatted or to automatically create a PR with the formatted codeUse natspec comments to document Command.sol
Currently we use the same API and a similar underlying implementation as forge-std console2. The difference is that we use a custom type constant that provides the log
functions through a library and using ... for
.
The reasoning was to allow extending the console
by creating other libraries that add log
functions for user defined types (structs, enums, etc). The downside is that it isn't consistent with the other modules (for other modules a library is imported instead of a custom type constant).
Figure out if there is a better way to achieve this.
Use natspec comments to document Accounts.sol
We need to show how to build a JSON object with multiple properties.
Use natspec comments to document Json.sol
Use natspec comments to document Fork.sol
Update the readme file including:
vulcan
vulcan
vulcan
Foundry's built in gas reports leave a lot to be desired. Often times what I want to test in terms of gas usage is not 1:1 with tests, so creating individual tests just for the purposes of making a call to determine gas usage feels a little silly.
In our recently overhaul of MUD internals, we've added our own gas report tooling using a special // !gasreport
line in our tests that wraps the next line in a gasleft()
calculation, executes the test, and then records the gas usage to a file that we check in and compare in each PR to see how gas is changing. This works but is very slow and clunky.
I'd love for some official Solidity gas reporting support, something along the lines of:
function testBehavior() public {
// calculates gas used by next line
reportGas('abi encode');
abi.encode('hello world');
// calculates gas within the start/end calls
// block added for readability
startReportGas('mint and burn');
{
mint();
burn();
}
endReportGas();
}
Related:
Figure out if a new module makes sense for rpcUrl
methods. It could also include other helpers such as isTest
, isScript
, etc. Another alternative would be to add these to an existing module such as ctx
or env
.
It uses it's local storage so accounts is not really necessary (can just use a storage pointer)
script.sol
Use natspec comments to document Strings.sol
A few things like expect(1).toEqual(1)
won't compile because the compiler won't be able to determine the type.
We have two options:
script.sol
and test.sol
, and only use safe libs in script.Add a method to the accounts
module to generate an array of addresses with an specific length
Export the huff
module and Huffc
struct from src/script.sol
Add tests for the Fs
namespace
Use natspec comments to document Watcher.sol
Use natspec comments to document Env.sol
Add tests for the Env
namespace
Add tests for the Events
namespace
Use natspec comments to document Vulcan.sol
Same as https://github.com/foundry-rs/forge-std/blob/master/src/StdInvariant.sol it needs to include those view functions. The way of adding targets could be different though.
Provide a way to optionally use a label prefix when generating multiple addresses.
Same as explained in https://github.com/foundry-rs/forge-std/blob/7b4876e8de2a232a54159035f173e35421000c19/src/StdUtils.sol#L187
We probably don't want to compile the whole Console.sol contract when importing things like println
, so we should have a separate function for this.
Add tests for the Accounts
namespace
Create a template that includes Vulcan. Something similar to https://github.com/PaulRBerg/foundry-template
Use natspec comments to document Context.sol
Use natspec comments to document Expect.sol
Use natspec comments to document Events.sol
Use natspec comments to document Fs.sol
Add sections to the book
If we could parse toml
files we could improve the Config
module to obtain settings from
foundry.toml
Add tests for the Context
namespace
Add tests for the Fork
namespace
Use natspec comments to document Console.sol
It would be cool to have something like:
import {Test, events} from "vulcan/lib.sol";
contract TestMyContract is Test {
function testMyContract() external {
events.watch("Transfer(...)");
// Do stuff...
Log[] memory logs = events.getWatched("Transfer(...)")
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.