Block Reference

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).

Warning
The generated Solidity always imports from OpenZeppelin at a pinned version. Do not upgrade OZ without re-running the full security pipeline.

Token Standards

Standard fungible and non-fungible token implementations from OpenZeppelin v5.

ERC-20 Tokenoz_erc20
OpenZeppelin v5

The standard fungible token. Configurable mint, burn, pause, permit (EIP-2612), and votes (EIP-5805) extensions. All extensions are opt-in via boolean properties.

PropertyTypeDefaultDescription
namestringMyTokenToken full name (e.g. 'My Token')
symbolstringMTKToken ticker symbol (e.g. 'MTK')
premintuint2560Amount minted to deployer in constructor (in whole tokens)
mintablebooltrueAdds a mint() function gated by MINTER_ROLE
burnableboolfalseAdds burnFrom() and burn() functions
pausableboolfalseAdds Pausable, gated by PAUSER_ROLE
permitboolfalseAdds EIP-2612 permit() for gasless approvals
votesboolfalseAdds EIP-5805 on-chain voting power (required for Governor)
ERC-721 NFToz_erc721
OpenZeppelin v5

Non-fungible token (NFT) standard with optional enumerable extension, ERC-2981 royalties, burnable, and URI storage.

PropertyTypeDefaultDescription
namestringMyNFTCollection name
symbolstringNFTCollection symbol
maxSupplyuint25610000Maximum tokens that can be minted (0 = unlimited)
baseURIstringBase URI for tokenURI() (appends tokenId)
mintPriceuint2560Price in wei per mint (0 = free)
royaltyBpsuint96500Royalty in basis points (500 = 5%). Requires ERC-2981 block connected.
ERC-1155 Multi-Tokenoz_erc1155
OpenZeppelin v5

Batch-friendly multi-token standard for mixed fungible/non-fungible assets. Single contract manages multiple token IDs.

PropertyTypeDefaultDescription
uristringBase URI for token metadata. Use {id} placeholder for per-token URIs.
burnableboolfalseAdds burn() and burnBatch()
supplyboolfalseAdds totalSupply() tracking per token ID
ERC-4626 Yield Vaultoz_erc4626
OpenZeppelin v5

Tokenized yield-bearing vault. Users deposit an underlying ERC-20, receive shares in return. Yield is reflected in the share price.

PropertyTypeDefaultDescription
namestringMy VaultVault share token name
symbolstringvTKNVault share token symbol
assetaddressAddress of the underlying ERC-20 asset
Royalties (ERC-2981)oz_erc2981
OpenZeppelin v5

NFT royalty info standard. Marketplaces query royaltyInfo() to determine how much to send the creator on each secondary sale.

PropertyTypeDefaultDescription
receiveraddressdeployerDefault royalty recipient address
feeBpsuint96500Royalty in basis points (500 = 5%, max 10000)

Access Control

Blocks that restrict who can call which functions.

Ownableoz_ownable
OpenZeppelin v5

Single-owner pattern. The deployer is the owner. Owner can call restricted functions and transfer ownership. The simplest access control pattern.

PropertyTypeDefaultDescription
twoStepboolfalseIf true, uses Ownable2Step (ownership transfer requires acceptance by new owner)
Access Controloz_accesscontrol
OpenZeppelin v5

Role-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.

PropertyTypeDefaultDescription
rolesarray[{"name":"MINTER"}]Array of role names to define. Each generates a bytes32 constant.
Timelock Controlleroz_timelock
OpenZeppelin v5

Adds 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.

PropertyTypeDefaultDescription
minDelayuint25686400Minimum delay in seconds before a queued operation can execute (86400 = 1 day)
proposersaddress[][]Addresses that can queue operations (usually the Governor contract)
executorsaddress[][]Addresses that can execute ready operations (address(0) = anyone)
Multisig Gatecustom_multisig_gate
Internal

M-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.

PropertyTypeDefaultDescription
thresholduint82Number of signatures required (M)
signersaddress[][]Set of authorised signers (N). Must have at least threshold entries.

Security Primitives

Defensive patterns that protect against common Solidity vulnerabilities.

Reentrancy Guardoz_reentrancyguard
OpenZeppelin v5

Prevents reentrancy attacks with a simple mutex. Decorate functions with the nonReentrant modifier. Essential for any function that transfers ETH or calls external contracts.

Pausableoz_pausable
OpenZeppelin v5

Emergency pause mechanism. An authorised address (owner or PAUSER_ROLE) can pause the contract, which blocks any function decorated with whenNotPaused.

Rate Limitercustom_ratelimiter
Internal

Token-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.

PropertyTypeDefaultDescription
maxAmountuint2561000000000000000000000Maximum amount per window (in wei or token smallest unit)
windowSecondsuint2563600Time window duration in seconds
Circuit Breakercustom_circuitbreaker
Internal

Automatically 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.

PropertyTypeDefaultDescription
thresholduint256100000000000000000000Value threshold that triggers auto-pause (in wei)
windowBlocksuint2561Number of blocks to measure the threshold over

DeFi Patterns

Finance and DeFi primitives for token economics and value flows.

Staking Poolcustom_staking_pool
Internal

Stake 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.

PropertyTypeDefaultDescription
rewardRateuint256100Reward tokens distributed per block
lockPerioduint2560Minimum staking duration in seconds before unstake is allowed (0 = no lock)
Vesting Scheduleoz_vesting_wallet
OpenZeppelin v5

Linear token vesting with optional cliff. Beneficiary receives tokens gradually over the vesting period. Used for team allocations, investor releases, and advisor tokens.

PropertyTypeDefaultDescription
beneficiaryaddressdeployerAddress that receives vested tokens
startTimestampuint64block.timestampVesting start time (Unix timestamp)
durationSecondsuint64126144000Total vesting duration in seconds (126144000 = 4 years)
P2P Escrowcustom_escrow
Internal

Two-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.

PropertyTypeDefaultDescription
arbiteraddressaddress(0)Optional trusted arbiter for dispute resolution (address(0) = no arbitration)
feeuint2560Arbiter fee in basis points (0 = free arbitration)
English Auctioncustom_english_auction
Internal

Ascending-price auction. Bidders submit increasing bids. When the auction ends, the highest bidder wins and all losing bids are automatically refunded.

PropertyTypeDefaultDescription
startingPriceuint2560Minimum starting bid in wei
minIncrementuint2561000000000000000Minimum bid increment in wei (default 0.001 ETH)
durationuint25686400Auction duration in seconds
extensionWindowuint256300Extension time (seconds) added when a bid arrives near end
Merkle Airdropcustom_merkle_airdrop
Internal

Gas-efficient airdrop using Merkle proof verification. The Merkle root is stored on-chain; recipients submit proofs off-chain. Each address can claim once.

PropertyTypeDefaultDescription
merkleRootbytes320x0Keccak256 Merkle root of the airdrop list. Must be set before claims begin.
tokenaddressERC-20 token address to distribute

Governance & DAO

Governor DAOoz_governor
OpenZeppelin v5

Full 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.

PropertyTypeDefaultDescription
votingDelayuint481Blocks after proposal creation before voting begins
votingPerioduint3250400Voting duration in blocks (~1 week at 12s/block)
quorumPercentuint2564Minimum % of total supply that must vote for a proposal to pass
proposalThresholduint2560Minimum token balance required to create a proposal
Governor Timelockoz_governor_timelock
OpenZeppelin v5

Execution 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 Feedchainlink_price_feed
Chainlink

Live 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.

PropertyTypeDefaultDescription
feedAddressaddress0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419Chainlink AggregatorV3 feed address on Mainnet (default: ETH/USD)
maxStalenessSecondsuint2563600Maximum age of the price answer before the call reverts (1 hour default)
Chainlink VRF v2.5chainlink_vrf
Chainlink

Verifiable 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.

PropertyTypeDefaultDescription
subscriptionIduint2560Your Chainlink VRF subscription ID (create at vrf.chain.link)
keyHashbytes320x9fe0...cGas lane key hash for Mainnet
callbackGasLimituint32100000Gas limit for the VRF callback
numWordsuint321Number of random values to request
Uniswap V3 TWAPuniswap_v3_twap
Uniswap

Time-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.

PropertyTypeDefaultDescription
pooladdressUniswap V3 pool address
secondsAgouint321800TWAP observation window in seconds (30 min default)

Upgradeability

Important
Upgradeable contracts are more complex. They require using initializers instead of constructors, storage layouts must be preserved across upgrades, and the upgrade authority must be carefully secured. Use only if you have a strong reason to upgrade.
UUPS Proxyoz_uups_proxy
OpenZeppelin v5

Universal 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.

Transparent Proxyoz_transparent_proxy
OpenZeppelin v5

Classic 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.

Beacon Proxyoz_beacon_proxy
OpenZeppelin v5

Multiple 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).

Initializeroz_initializer
OpenZeppelin v5

Replaces the constructor for upgradeable contracts. The initialize() function is protected with the initializer modifier to prevent re-initialisation. Always pair with any upgradeable block.

Block Reference — FlowNodes Docs | FlowNodes