Block Reference
Every block in FlowNodes maps to a well-tested Solidity component. Blocks marked OpenZeppelin v5 use the official OZ library at that version. Internal blocks are custom implementations reviewed for common Solidity pitfalls (reentrancy, integer overflow, access control).
Token Standards
Standard fungible and non-fungible token implementations from OpenZeppelin v5.
oz_erc20The standard fungible token. Configurable mint, burn, pause, permit (EIP-2612), and votes (EIP-5805) extensions. All extensions are opt-in via boolean properties.
| Property | Type | Default | Description |
|---|---|---|---|
| name | string | MyToken | Token full name (e.g. 'My Token') |
| symbol | string | MTK | Token ticker symbol (e.g. 'MTK') |
| premint | uint256 | 0 | Amount minted to deployer in constructor (in whole tokens) |
| mintable | bool | true | Adds a mint() function gated by MINTER_ROLE |
| burnable | bool | false | Adds burnFrom() and burn() functions |
| pausable | bool | false | Adds Pausable, gated by PAUSER_ROLE |
| permit | bool | false | Adds EIP-2612 permit() for gasless approvals |
| votes | bool | false | Adds EIP-5805 on-chain voting power (required for Governor) |
oz_erc721Non-fungible token (NFT) standard with optional enumerable extension, ERC-2981 royalties, burnable, and URI storage.
| Property | Type | Default | Description |
|---|---|---|---|
| name | string | MyNFT | Collection name |
| symbol | string | NFT | Collection symbol |
| maxSupply | uint256 | 10000 | Maximum tokens that can be minted (0 = unlimited) |
| baseURI | string | Base URI for tokenURI() (appends tokenId) | |
| mintPrice | uint256 | 0 | Price in wei per mint (0 = free) |
| royaltyBps | uint96 | 500 | Royalty in basis points (500 = 5%). Requires ERC-2981 block connected. |
oz_erc1155Batch-friendly multi-token standard for mixed fungible/non-fungible assets. Single contract manages multiple token IDs.
| Property | Type | Default | Description |
|---|---|---|---|
| uri | string | Base URI for token metadata. Use {id} placeholder for per-token URIs. | |
| burnable | bool | false | Adds burn() and burnBatch() |
| supply | bool | false | Adds totalSupply() tracking per token ID |
oz_erc4626Tokenized yield-bearing vault. Users deposit an underlying ERC-20, receive shares in return. Yield is reflected in the share price.
| Property | Type | Default | Description |
|---|---|---|---|
| name | string | My Vault | Vault share token name |
| symbol | string | vTKN | Vault share token symbol |
| asset | address | Address of the underlying ERC-20 asset |
oz_erc2981NFT royalty info standard. Marketplaces query royaltyInfo() to determine how much to send the creator on each secondary sale.
| Property | Type | Default | Description |
|---|---|---|---|
| receiver | address | deployer | Default royalty recipient address |
| feeBps | uint96 | 500 | Royalty in basis points (500 = 5%, max 10000) |
Access Control
Blocks that restrict who can call which functions.
oz_ownableSingle-owner pattern. The deployer is the owner. Owner can call restricted functions and transfer ownership. The simplest access control pattern.
| Property | Type | Default | Description |
|---|---|---|---|
| twoStep | bool | false | If true, uses Ownable2Step (ownership transfer requires acceptance by new owner) |
oz_accesscontrolRole-based access control. Define arbitrary roles (MINTER_ROLE, PAUSER_ROLE, etc.) and grant/revoke them per address. More flexible than Ownable for multi-admin contracts.
| Property | Type | Default | Description |
|---|---|---|---|
| roles | array | [{"name":"MINTER"}] | Array of role names to define. Each generates a bytes32 constant. |
oz_timelockAdds a mandatory delay before privileged operations execute. Used in DAO governance to prevent flash-loan attacks and give token holders time to react to proposals.
| Property | Type | Default | Description |
|---|---|---|---|
| minDelay | uint256 | 86400 | Minimum delay in seconds before a queued operation can execute (86400 = 1 day) |
| proposers | address[] | [] | Addresses that can queue operations (usually the Governor contract) |
| executors | address[] | [] | Addresses that can execute ready operations (address(0) = anyone) |
custom_multisig_gateM-of-N signature requirement. Certain function calls require off-chain collection of M signatures from a set of N signers before execution. Useful for treasury management.
| Property | Type | Default | Description |
|---|---|---|---|
| threshold | uint8 | 2 | Number of signatures required (M) |
| signers | address[] | [] | Set of authorised signers (N). Must have at least threshold entries. |
Security Primitives
Defensive patterns that protect against common Solidity vulnerabilities.
oz_reentrancyguardPrevents reentrancy attacks with a simple mutex. Decorate functions with the nonReentrant modifier. Essential for any function that transfers ETH or calls external contracts.
oz_pausableEmergency pause mechanism. An authorised address (owner or PAUSER_ROLE) can pause the contract, which blocks any function decorated with whenNotPaused.
custom_ratelimiterToken-bucket rate limiting. Limits how much value can flow through a function per time window. Useful for bridge contracts and withdrawal functions to limit damage from exploits.
| Property | Type | Default | Description |
|---|---|---|---|
| maxAmount | uint256 | 1000000000000000000000 | Maximum amount per window (in wei or token smallest unit) |
| windowSeconds | uint256 | 3600 | Time window duration in seconds |
custom_circuitbreakerAutomatically pauses the contract when an anomaly is detected (e.g. more than X ETH withdrawn in one block, or rapid state changes). Inspired by real DeFi incident patterns.
| Property | Type | Default | Description |
|---|---|---|---|
| threshold | uint256 | 100000000000000000000 | Value threshold that triggers auto-pause (in wei) |
| windowBlocks | uint256 | 1 | Number of blocks to measure the threshold over |
DeFi Patterns
Finance and DeFi primitives for token economics and value flows.
custom_staking_poolStake token A to earn token B rewards. Linear emission model. Tracks per-user reward debt for gas-efficient claims. Based on the widely-used MasterChef pattern.
| Property | Type | Default | Description |
|---|---|---|---|
| rewardRate | uint256 | 100 | Reward tokens distributed per block |
| lockPeriod | uint256 | 0 | Minimum staking duration in seconds before unstake is allowed (0 = no lock) |
oz_vesting_walletLinear token vesting with optional cliff. Beneficiary receives tokens gradually over the vesting period. Used for team allocations, investor releases, and advisor tokens.
| Property | Type | Default | Description |
|---|---|---|---|
| beneficiary | address | deployer | Address that receives vested tokens |
| startTimestamp | uint64 | block.timestamp | Vesting start time (Unix timestamp) |
| durationSeconds | uint64 | 126144000 | Total vesting duration in seconds (126144000 = 4 years) |
custom_escrowTwo-party escrow with an optional arbiter for dispute resolution. Buyer deposits ETH or ERC-20, seller fulfils, buyer releases — or either party escalates to arbiter.
| Property | Type | Default | Description |
|---|---|---|---|
| arbiter | address | address(0) | Optional trusted arbiter for dispute resolution (address(0) = no arbitration) |
| fee | uint256 | 0 | Arbiter fee in basis points (0 = free arbitration) |
custom_english_auctionAscending-price auction. Bidders submit increasing bids. When the auction ends, the highest bidder wins and all losing bids are automatically refunded.
| Property | Type | Default | Description |
|---|---|---|---|
| startingPrice | uint256 | 0 | Minimum starting bid in wei |
| minIncrement | uint256 | 1000000000000000 | Minimum bid increment in wei (default 0.001 ETH) |
| duration | uint256 | 86400 | Auction duration in seconds |
| extensionWindow | uint256 | 300 | Extension time (seconds) added when a bid arrives near end |
custom_merkle_airdropGas-efficient airdrop using Merkle proof verification. The Merkle root is stored on-chain; recipients submit proofs off-chain. Each address can claim once.
| Property | Type | Default | Description |
|---|---|---|---|
| merkleRoot | bytes32 | 0x0 | Keccak256 Merkle root of the airdrop list. Must be set before claims begin. |
| token | address | ERC-20 token address to distribute |
Governance & DAO
oz_governorFull on-chain governance with proposal creation, voting, and execution. Token holders vote with their ERC-20 (with votes extension). Quorum is enforced. Requires a connected Timelock.
| Property | Type | Default | Description |
|---|---|---|---|
| votingDelay | uint48 | 1 | Blocks after proposal creation before voting begins |
| votingPeriod | uint32 | 50400 | Voting duration in blocks (~1 week at 12s/block) |
| quorumPercent | uint256 | 4 | Minimum % of total supply that must vote for a proposal to pass |
| proposalThreshold | uint256 | 0 | Minimum token balance required to create a proposal |
oz_governor_timelockExecution delay extension for the Governor. Passed proposals are queued in the TimelockController and can only execute after minDelay seconds. Prevents flash-loan governance attacks.
Oracles & Data Feeds
chainlink_price_feedLive asset price from Chainlink Data Feeds. Returns latest price with staleness check. FlowNodes defaults to the ETH/USD feed for the payment vault, but you can point it at any Chainlink feed.
| Property | Type | Default | Description |
|---|---|---|---|
| feedAddress | address | 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 | Chainlink AggregatorV3 feed address on Mainnet (default: ETH/USD) |
| maxStalenessSeconds | uint256 | 3600 | Maximum age of the price answer before the call reverts (1 hour default) |
chainlink_vrfVerifiable on-chain randomness. Request a random number from Chainlink VRF; the callback fulfillRandomWords() is called with the result. Used for NFT reveals, lotteries, and game mechanics.
| Property | Type | Default | Description |
|---|---|---|---|
| subscriptionId | uint256 | 0 | Your Chainlink VRF subscription ID (create at vrf.chain.link) |
| keyHash | bytes32 | 0x9fe0...c | Gas lane key hash for Mainnet |
| callbackGasLimit | uint32 | 100000 | Gas limit for the VRF callback |
| numWords | uint32 | 1 | Number of random values to request |
uniswap_v3_twapTime-Weighted Average Price oracle using a Uniswap V3 pool. TWAP prices are manipulation-resistant over longer windows. Used as an alternative to Chainlink for long-tail assets.
| Property | Type | Default | Description |
|---|---|---|---|
| pool | address | Uniswap V3 pool address | |
| secondsAgo | uint32 | 1800 | TWAP observation window in seconds (30 min default) |
Upgradeability
oz_uups_proxyUniversal Upgradeable Proxy Standard. The upgrade logic lives in the implementation contract, not the proxy. More gas-efficient than Transparent Proxy. Requires UUPSUpgradeable in the implementation.
oz_transparent_proxyClassic transparent proxy with a separate ProxyAdmin contract. The admin can upgrade but cannot call implementation functions. Safer separation of concerns than UUPS for multi-party deployments.
oz_beacon_proxyMultiple proxy instances all point at a single UpgradeableBeacon. Upgrading the beacon upgrades all proxies simultaneously. Useful for factory patterns (e.g. deploy 100 NFT collections from one implementation).
oz_initializerReplaces the constructor for upgradeable contracts. The initialize() function is protected with the initializer modifier to prevent re-initialisation. Always pair with any upgradeable block.
