@yellow-org/contracts
v1.0.4
Published
Typed ABIs and deployed addresses for Yellow Network smart contracts
Downloads
430
Keywords
Readme
@yellow-org/contracts
Typed ABIs and deployed addresses for all Yellow Network smart contracts. Works with viem, ethers.js, wagmi, or any EVM library.
Install
npm install @yellow-org/contractsyarn add @yellow-org/contractspnpm add @yellow-org/contractsbun add @yellow-org/contractsUsage
viem
import { createPublicClient, http } from "viem";
import { mainnet } from "viem/chains";
import { NodeRegistryAbi, addresses } from "@yellow-org/contracts";
const client = createPublicClient({
chain: mainnet,
transport: http(),
});
// Read a node operator's locked collateral — fully typed
const balance = await client.readContract({
address: addresses[1].nodeRegistry!,
abi: NodeRegistryAbi,
functionName: "balanceOf",
args: ["0x..."],
});ethers v6
import { Contract, JsonRpcProvider } from "ethers";
import { NodeRegistryAbi, addresses } from "@yellow-org/contracts";
const provider = new JsonRpcProvider("https://eth.llamarpc.com");
const nodeRegistry = new Contract(
addresses[1].nodeRegistry!,
NodeRegistryAbi,
provider
);
const balance = await nodeRegistry.balanceOf("0x...");wagmi (React)
import { useReadContract } from "wagmi";
import { NodeRegistryAbi, addresses } from "@yellow-org/contracts";
function LockedCollateral({ user }: { user: `0x${string}` }) {
const { data: balance } = useReadContract({
address: addresses[1].nodeRegistry!,
abi: NodeRegistryAbi,
functionName: "balanceOf",
args: [user],
});
return <span>{balance?.toString()} YELLOW</span>;
}Exports
ABIs
import {
YellowTokenAbi,
NodeRegistryAbi,
AppRegistryAbi,
YellowGovernorAbi,
TimelockControllerAbi,
TreasuryAbi,
FaucetAbi,
ILockAbi,
ISlashAbi,
} from "@yellow-org/contracts";| Export | Contract | Description |
|---|---|---|
| YellowTokenAbi | YellowToken | ERC-20 + EIP-2612 permit |
| NodeRegistryAbi | NodeRegistry | Staking + voting (ILock + IVotes) |
| AppRegistryAbi | AppRegistry | Collateral + slashing (ILock + ISlash + AccessControl) |
| YellowGovernorAbi | YellowGovernor | Governance (Governor + extensions) |
| TimelockControllerAbi | TimelockController | Delayed execution |
| TreasuryAbi | Treasury | Foundation vault |
| FaucetAbi | Faucet | Testnet faucet |
| ILockAbi | ILock | Lock/unlock interface (shared by both registries) |
| ISlashAbi | ISlash | Slash interface |
All ABIs are exported as as const arrays for full type inference with viem and wagmi.
JSON ABIs
Plain JSON files are also available for tools that consume raw ABI (Hardhat, Foundry, etc.):
import NodeRegistryAbi from "@yellow-org/contracts/abi/NodeRegistry.json";Addresses
import { addresses, type ContractAddresses } from "@yellow-org/contracts";
addresses[1] // Ethereum Mainnet
addresses[11155111] // Sepolia TestnetGeneric registry code
Use ILockAbi to write code that works with both NodeRegistry and AppRegistry:
import { ILockAbi } from "@yellow-org/contracts";
const balance = await client.readContract({
address: registryAddress,
abi: ILockAbi,
functionName: "balanceOf",
args: [userAddress],
});Deployed Addresses
Ethereum Mainnet (Chain ID: 1)
| Contract | Address |
|---|---|
| YellowToken | 0x236eB848C95b231299B4AA9f56c73D6893462720 |
| NodeRegistry | 0xB0C7aA4ca9ffF4A48B184d8425eb5B6Fa772d820 |
| AppRegistry | 0x5A70029B843eE272A2392acE21DA392693eef1c6 |
| YellowGovernor | 0x7Ce0AE21E11dFEDA2F6e4D8bF2749E4061119512 |
| TimelockController | 0x9530896F9622b925c37dF5Cfa271cc9deBB226b7 |
| Treasury (Founder) | 0x914abaDC0e36e03f29e4F1516951125c774dBAc8 |
| Treasury (Community) | 0xAec5157545635A7523EFB5ABe3a37F52dB7DE72e |
| Treasury (Token Sale) | 0xd572f3a0967856a09054578439aCe81B2f2ff88B |
| Treasury (Foundation) | 0xfD8E336757aE9cDc0766264064B51492814fCd47 |
| Treasury (Network) | 0xE277830b3444EA2cfee2B95F780c971222DEcfA9 |
| Treasury (Liquidity) | 0xA8f52FFe4DeE9565505f8E390163A335D6A2F708 |
Sepolia Testnet (Chain ID: 11155111)
| Contract | Address |
|---|---|
| YellowToken | 0x236eB848C95b231299B4AA9f56c73D6893462720 |
| Treasury (Founder) | 0x6f4eeD96cA1388803A9923476a0F5e19703d1e7C |
| Treasury (Community) | 0x3939a80FE4cc2F16F1294a995A4255B68d8c1F27 |
| Treasury (Token Sale) | 0x9b4742c0aEFfE3DD16c924f4630F6964fe1ad420 |
| Treasury (Foundation) | 0xbb5006195974B1d3c36e46EA2D7665FE1E65ADf2 |
| Treasury (Network) | 0x72F4461A79AB44BbCf1E70c1e3CE9a5a2C2e1920 |
| Treasury (Liquidity) | 0x5825BD45C3f495391f4a7690be581b1c91Ac6959 |
| Faucet | 0x914abaDC0e36e03f29e4F1516951125c774dBAc8 |
License
GPL-3.0-or-later
