
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@witnet/solidity
Advanced tools
Contracts, wrappers, and CLI tooling for running and integrating the Wit/Oracle stack on EVM-compatible networks.
pnpm install
npx witeth networks
npx witeth gateway <ecosystem:chain>
npx witeth framework --verbose
<run your deployment pipeline for ecosystem:chain>
npm install @witnet/solidity
npx witeth priceFeeds
npx witeth randomness
npx witeth queries --limit 20
npx witeth reports --limit 20 --parse
npx witeth assets --all --decode
npx witeth assets <assetName> --dry-run
npm install @witnet/solidity ethers
import { ethers, utils } from "@witnet/solidity";
const provider = new ethers.JsonRpcProvider(process.env.ETH_RPC_URL!);
const framework = await utils.fetchWitOracleFramework(provider);
console.log(Object.keys(framework));
import { WitOracle } from "@witnet/solidity";
const witOracle = await WitOracle.fromEthRpcProvider(provider);
const randomness = await witOracle._getWitRandomness();
console.log(await randomness.getEvmChainId());
Network-specific behavior is controlled by your network metadata, artifact mapping, and deployment specs sources of truth.
Recommended decision flow for WitOracle implementation selection:
Preflight:
pnpm run fmt
pnpm run compile
Run selective upgrade using your internal release process for the targeted artifacts.
Run full upgrade only through your approved change-management process.
Validate upgraded state:
npx witeth gateway <ecosystem:chain>
npx witeth framework --verbose
Add the network to your supported-network catalog using the name pattern ecosystem:chain.
Add artifact overrides when defaults are not enough.
Add deployment specs for mutables, immutables, dependencies, or libs.
Deploy using your approved deployment automation.
Verify and smoke-test:
npx witeth gateway <ecosystem:chain>
npx witeth framework --verbose
npx witeth priceFeeds
npx witeth randomness
You can enumerate supported feeds both on-chain and from CLI.
Solidity path:
IWitPriceFeeds.lookupPriceFeeds().PriceFeedInfo[], where each item includes:id: 32-byte feed id.exponent: decimals exponent for interpreting price values.symbol: human-readable caption.mapper: mapping definition when feed is derived from dependencies.oracle: oracle target and source identifiers.updateConditions: heartbeat, deviation, witness, and callback settings.lastUpdate: last known Price (exponent, price, deltaPrice, timestamp, trail).CLI path:
npx witeth priceFeeds.ID4: 4-byte identifier used by native IWitPriceFeeds reads.CAPTION: price feed caption/symbol.FRESHNESS: relative age of last update (for example, "2 minutes ago").DATA PROVIDERS: upstream providers or composed dependencies used for the feed.You can read the same subsidized feed through four compatibility paths:
IWitPriceFeeds)IERC2362-style valueFor(bytes32))IWitPyth methods)IWitPythChainlinkAggregator / Chainlink V3 methods)IWitPriceFeeds)Methods:
getPrice(ID4 id4)getPriceNotOlderThan(ID4 id4, uint24 age)getPriceUnsafe(ID4 id4)Arguments:
id4: 4-byte feed identifier, usually derived from caption (for example via computeID4("Price-ETH/USD-6")).age: max accepted staleness in seconds (getPriceNotOlderThan only).Possible reverts:
PriceFeedNotFound() when the feed is not supported.StalePrice() on stale updates (getPrice, getPriceNotOlderThan).InvalidGovernanceTarget() if EMA-governed conditions are unmet for the feed.Expected return:
Price struct with exponent, price, deltaPrice, timestamp, trail.price * 10^exponent.valueFor(bytes32))Method:
valueFor(bytes32 id)Arguments:
id: 32-byte feed id (typically from computeID32(caption)).Possible reverts:
Expected return:
(int256 value, uint256 timestamp, uint256 status).200: fresh value.400: stale value.404: feed not found / no value yet.IWitPyth)Methods:
getPrice(bytes32 id)getPriceNotOlderThan(bytes32 id, uint64 age)getPriceUnsafe(bytes32 id)getEmaPrice(bytes32 id)getEmaPriceNotOlderThan(bytes32 id, uint64 age)getEmaPriceUnsafe(bytes32 id)Arguments:
id: 32-byte feed id (IWitPyth.ID, backed by bytes32).age: max accepted staleness in seconds for *NotOlderThan variants.Possible reverts:
PriceFeedNotFound() when feed is unsupported.StalePrice() on stale values in sanity-checked variants.InvalidGovernanceTarget() for invalid EMA/governance configuration.Expected return:
PythPrice struct: price (int64), conf (uint64), expo (int32), publishTime (uint).Unsafe variants prioritize availability over freshness guarantees.IWitPythChainlinkAggregator)Flow:
IWitPriceFeeds.createChainlinkAggregator(string caption).IWitPythChainlinkAggregator (which extends Chainlink V3 interface).Key methods after creation:
latestRoundData(), getRoundData(uint80), decimals(), description(), version().id4(), priceId(), symbol(), witOracle().Arguments:
caption: feed caption used in WitPriceFeeds (for example Price-ETH/USD-6).roundId: Chainlink-compatible round selector when using getRoundData.Possible reverts:
createChainlinkAggregator reverts if caption is not supported.Expected return:
(roundId, answer, startedAt, updatedAt, answeredInRound).answer is the price value adapted to Chainlink-style consumers.// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;
import { IWitPriceFeeds, IWitPriceFeedsTypes } from "@witnet/solidity/contracts/interfaces/IWitPriceFeeds.sol";
import { IWitPyth } from "@witnet/solidity/contracts/interfaces/legacy/IWitPyth.sol";
import { IWitPythChainlinkAggregator } from "@witnet/solidity/contracts/interfaces/legacy/IWitPythChainlinkAggregator.sol";
interface IERC2362 {
function valueFor(bytes32 id) external view returns (int256 value, uint256 timestamp, uint256 status);
}
contract FeedReadExamples {
IWitPriceFeeds public immutable feeds;
constructor(address feedsAddress) {
feeds = IWitPriceFeeds(feedsAddress);
}
// 1) Witnet-native
function readNative(bytes4 id4)
external
view
returns (IWitPriceFeedsTypes.Price memory checked, IWitPriceFeedsTypes.Price memory unsafe_)
{
checked = feeds.getPrice(IWitPriceFeedsTypes.ID4.wrap(id4));
unsafe_ = feeds.getPriceUnsafe(IWitPriceFeedsTypes.ID4.wrap(id4));
}
// 2) ERC-2362 compatibility
function readErc2362(bytes32 id32) external view returns (int256 value, uint256 timestamp, uint256 status) {
return IERC2362(address(feeds)).valueFor(id32);
}
// 3) Pyth-adapted compatibility
function readPyth(bytes32 id32)
external
view
returns (IWitPyth.PythPrice memory spot, IWitPyth.PythPrice memory ema)
{
IWitPyth.ID id = IWitPyth.ID.wrap(id32);
spot = feeds.getPriceNotOlderThan(id, 300);
ema = feeds.getEmaPriceUnsafe(id);
}
// 4) Chainlink-adapted compatibility
function createAndReadChainlink(string calldata caption)
external
returns (address aggregator, int256 answer, uint256 updatedAt)
{
aggregator = feeds.createChainlinkAggregator(caption);
(, answer, , updatedAt, ) = IWitPythChainlinkAggregator(aggregator).latestRoundData();
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;
import { IWitPythChainlinkAggregator } from "@witnet/solidity/contracts/interfaces/legacy/IWitPythChainlinkAggregator.sol";
contract FeedReadChainlinkOnly {
IWitPythChainlinkAggregator public immutable adapter;
constructor(address adapterAddress) {
adapter = IWitPythChainlinkAggregator(adapterAddress);
}
function readLatest()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
return adapter.latestRoundData();
}
function metadata()
external
view
returns (bytes4 id4, bytes32 priceId, string memory symbol, address witOracle, uint8 decimals)
{
return (adapter.id4(), adapter.priceId(), adapter.symbol(), adapter.witOracle(), adapter.decimals());
}
}
See the @witnet/price-feeds README:
See the @witnet/price-feeds README:
See the @witnet/price-feeds README:
Call randomize on the WitRandomness contract from your contract flow, then consume finalized entropy once available.
npx witeth randomness --target <wit_randomness_address> --randomize --signer <evm_address>
npx randomizer --target <wit_randomness_address>
Pattern:
npx witeth randomness --target <wit_randomness_address> --clone --signer <evm_address>
Radon Request is the programmable query definition in Witnet: sources, transforms, aggregation, and commit/reveal consensus knobs.
npx witeth assets --all --decode
npx witeth assets <request_or_template> --dry-run
npx witeth assets <request_or_template> --deploy
Use queries and reports commands to inspect pull and push workflows by RAD hash:
npx witeth queries --filter-radHash <rad_hash_fragment>
npx witeth reports --filter-radHash <rad_hash_fragment> --parse
Commonly used functions:
import { ethers, utils } from "@witnet/solidity";
const provider = new ethers.JsonRpcProvider(process.env.ETH_RPC_URL!);
const framework = await utils.fetchWitOracleFramework(provider);
for (const [name, artifact] of Object.entries(framework)) {
console.log(name, artifact.address, artifact.class, artifact.semVer);
}
MIT
FAQs
Wit/Oracle Solidity Framework for EVM-compatible chains
We found that @witnet/solidity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.