
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@unfinishedlabs/contracts
Advanced tools
The official DSNP interface and implementations.
$ npm install @unfinishedlabs/contracts
const announcer = require("@unfinishedlabs/contracts/abi/Announcer.json");
const annoucerABI = announcer.abi;
// Requires "resolveJsonModule": true in [tsconfig](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
import { abi as announcerABI } from "@unfinishedlabs/contracts/abi/Announcer.json";
To maintain types, it is suggested to use TypeChain.
"postinstall": "typechain --target=(ethers-v5|web3-v1|other...) node_modules/@unfinishedlabs/contracts/**/*.json --outDir ./types/typechain""build:web3types": "typechain --target=web3-v1 node_modules/@unfinishedlabs/contracts/**/*.json --outDir ./types/typechain"--outDir is in tsconfig typeRoots.// web3 example
import web3 from "web3";
import { Announcer } from "./types/typechain/Announcer";
import { abi as announcerABI } from "@unfinishedlabs/contracts/abi/Announcer.json";
const getAnnouncerContract = (contractAddress: string) => {
// web3 requires the type cast
return new web3.eth.Contract(announcerABI, contractAddress) as Announcer;
}
// ethersjsv5 example
import { Provider } from "@ethersproject/providers";
import { Announcer } from "./types/typechain/Announcer";
const getAnnouncerContract = (contractAddress: string, provider: Provider) => {
// TypeChain for Ethers provides factories
return Announcer__factory.connect(contractAddress, provider);
}
Once installed, you can use the contracts in the library by importing them:
pragma solidity ^0.8.0;
import "@unfinishedlabs/contracts/IAnnounce.sol";
contract MyAnnouncer is IAnnounce {
// ...
}
We are using hardhat to compile and deploy the contracts
Basic Command List:
npm installnpm run clean - clears the cache and deletes all artifactsnpm run compile - compiles the entire project, building all artifactsnpm run console - opens a hardhat consolenpm run test - runs mocha testsnpm run lint - to run the linternpm run format - to trigger formattingnpm run deploy:testnet - deploys our deploy.ts script to our POA testnet defined in the hardhat.config.tsEnvironment Variables
.env file and set values for all variables in .env.sample| Env Variable Name | Description |
|---|---|
| LOCAL_NETWORK_PRIVATE_KEY | private key for an account we have on our local network that has eth. |
| STAGENET_ACCOUNT_PRIVATE_KEY | private key for an account we have on our test network that has eth. |
| STAGENET_CHAIN_URL | Url to connect to tesnet |
| VALIDATOR1 | hex prefixed address for validator running on node called liberty-chain |
| VALIDATOR2 | hex prefixed address for validator running on node called liberty-chain1 |
| BOOTNODE | enode address of the node our node would like to connect to |
FAQs
Official DSNP Interfaces, Contracts, and ABIs
We found that @unfinishedlabs/contracts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.