Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Abitty cherry-picks specific functions from your Solidity ABIs and saves them for individual importing. Stop using thicc JSON files, start shaking that tree.
Abitty cherry-picks specific functions from your Solidity ABIs and saves them for individual importing. Stop using thicc JSON files, start shaking that tree.
Create abitty.config.json
in your project directory.
{
"outputDir": "./src/types",
"organize": true,
"contracts": [
{
"name": "foo",
"abiPath": "../out/Foo.sol/Foo.json",
"pick": ["someFunction", "someOtherFunction", "amazingFunction"]
},
{
"name": "bar",
"abiPath": "../out/Bar.sol/Bar.json",
"pick": ["excellentFunction"]
}
]
}
key | required | |
---|---|---|
outputDir | Relative path where the generated files will go | Yes |
organize | If true , organizes contract files in folders and creates a single entrypoint | No |
contracts | An array of Contract s 👇 | Yes |
Contract.name | Used for generating folder names, required if organize is set to true | Sometimes |
Contract.abiPath | Path to your Solidity build artifact's JSON file | Yes |
Contract.pick | Functions you want to use | Yes |
Install as a dev dependency and add to your package scripts
npm install abitty --save-dev
"scripts": {
"gimme-them-abis": "abitty"
},
or skip this above and run with npx
npx abitty
The script will output an individual .ts file for each function, plus a helper type you can use to ensure arguments passed to that function satisfy the ABI.
If you are using a different configuration file, pass it to Abitty with the --config-file
flag.
They work great with Viem / Wagmi which you should definitely be using.
import { doTheFooAbi, DoTheFooArgs } from 'yourOutputDir/foo/doTheFoo';
await publicClient.simulateContract({
abi: [doTheFooAbi],
address: fooAddress,
functionName: 'doTheFoo',
args: [myArg1, myArg2, myArg3],
account: userAccount,
});
// You can use the generated argument typings like so:
const myArgs = [myArg1, myArg2, myArg3] satisfies DoTheFooArgs;
MIT license, do whatever you want with it. Contributions welcome.
Like it? Love it? Donate a few dollars to your local humane society for the fluffies 🐶🐱
FAQs
Abitty cherry-picks specific functions from your Solidity ABIs and saves them for individual importing. Stop using thicc JSON files, start shaking that tree.
We found that abitty demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.