Skip to content

@contracts:solidity.contract

Compile Solidity source (inline text or a http/ipfs URL) and return the qualified contract name (File.sol:Contract), ready for verify --contract-name. Pass the same options as the matching @solidity call so the cached compile is reused.

⚗️ Experimental — available at next.evmcrispr.com.

Returns: string

@contracts:solidity.contract(source version:<value> runs:<value> optimizer:<value> via-ir:<value> evm:<value> contract:<value>)
NameTypeDescription
sourcestringSolidity source code, or a URL to fetch it from
version:stringCompiler release, e.g. version:0.8.26 (default: from the pragma)
runs:numberOptimizer runs, e.g. runs:1000 (default: 200)
optimizer:booloptimizer:false disables the optimizer
via-ir:boolvia-ir:true compiles through the IR pipeline
evm:stringEVM version, e.g. evm:cancun
contract:stringTarget contract name when the source defines several
# Get the qualified contract name for verification
set $name @contracts:solidity.contract('https://sources.example.com/Counter.sol')
print $name