.claude/skills/tevm-contract-deployment/SKILL.md
Deploy contracts using ethers ContractFactory with Tevm. Use when deploying contracts in tests or local development.
npx skillsauth add cyotee/crane tevm-contract-deploymentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
import { ContractFactory } from 'ethers'
import { Wallet } from 'ethers'
import { createMemoryClient } from 'tevm'
import { parseEther } from 'viem'
const client = createMemoryClient()
// Create signer
const signer = Wallet.createRandom().connect(
new ethers.BrowserProvider(client)
)
// Fund the account
await client.setBalance({
address: signer.address,
value: parseEther('10')
})
// Create factory
const factory = new ContractFactory(abi, bytecode, signer)
// Deploy
const contract = await factory.deploy(...constructorArgs)
// Mine the deployment
await client.mine({ blocks: 1 })
// Get address
const address = await contract.getAddress()
console.log('Deployed to:', address)
import { tevmDeploy } from 'tevm/actions'
const result = await tevmDeploy(client, {
abi,
bytecode,
args: [arg1, arg2],
from: deployerAddress,
gasLimit: 1000000n
})
console.log('Address:', result.address)
console.log('Gas used:', result.gasUsed)
// If constructor takes arguments, include in bytecode or pass as args
const contract = await factory.deploy(arg1, arg2)
// Or with tevmDeploy
const result = await tevmDeploy(client, {
abi,
bytecode: bytecodeWithConstructor,
args: [arg1, arg2]
})
// Listen for deployment events
contract.on('Transfer', (from, to, amount, event) => {
console.log('Transfer:', from, to, amount)
console.log('Block:', event.blockNumber)
console.log('Tx:', event.transactionHash)
})
// Query past events
const filter = contract.filters.Transfer()
const events = await contract.queryFilter(filter, -1000, 'latest')
// Set initial storage
await client.setAccount({
address: contractAddress,
state: {
[slot0]: value0,
[slot1]: value1
}
})
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
documentation
Write to contracts and send transactions. Use when executing state-changing contract functions.
development
HTTP and WebSocket transports for blockchain connectivity. Use when configuring network connections.
data-ai
Read contract data with type-safe ABI. Use when querying smart contract view/pure functions.