Alejandro Betancourt (alebeta06)

Alejandro Betancourt

Web3 × AI Engineer · Smart Contracts (Solidity, Cairo) · MCP + Agentic Workflows · Shipping on Ethereum, Base & Starknet · Learning Rust

35 Followers

Recent casts

Top casts

This screenshot says 100% coverage. I still don't trust it. A test can hit every line and assert nothing real: the quantity that should sum, the createdAt that shouldn't move, the index left dangling after a swap. Coverage = what ran. Assertions = what you actually checked. 🔑

  • 0 replies
  • 0 recasts
  • 2 reactions

Solidity gotcha: `delete myArray` empties the array but leaves your index mapping pointing at ghosts. Re-add a deleted item and it sneaks into a phantom slot → out-of-bounds panic. Clear each key first, then nuke the array. The mapping never sees your delete coming.

  • 0 replies
  • 0 recasts
  • 2 reactions

Underused Solidity pattern: `using-for` Verbose: StockLib.decrease(stocks, id, qty); With `using StockLib for mapping(...)`: stocks.decrease(id, qty); Same gas. Cleaner code. Methods on your types. The value before the dot becomes the first arg. Canonical Solidity pattern.

  • 0 replies
  • 1 recast
  • 1 reaction

The EVM revert gives you atomicity for free. Killed a "validate all stock first" loop in my multi-vendor checkout. decrementStock already reverts when stock runs short — and one revert unwinds the entire tx: stock, invoices, payments already sent. The revert IS your rollback. 🔑

  • 0 replies
  • 0 recasts
  • 2 reactions

Onchain profile

Ethereum addresses