Get early access

ERC-20 Transfer

A canonical ERC-20 written in 11 lines of TypeScript. Same selectors, same gas, same audit surface as Solidity.

ContractsToolingCompile
How it runsBase mainnet · 8453
Inputs
tokenName=My Tokensymbol=MYTinitialSupply=1,000,000,000chain=Base
Compile-time
01Parse TypeScript with EVM-native typesAST built
02Type-check against the EVM type system0 errors
03Emit EVM bytecode4,021 bytes
04Verify selectors against standard ERC-20
match → ready to deploymismatch → fail compile
05Deploy to chain0xa19c...3b40
Result
1 contract · same bytecode as Solidity ERC-20
erc20.sauce.ts
Base · 8453READ-ONLY
1// ERC-20 transfer as SauceScript. Balances live in storage,2// keyed by keccak256(account, slot). The compiler emits Sauce3// bytecode the same engine executes on chain.4function balanceSlot(account) {5 return crypto.keccak256(abi.encode(account, 1));6}78function main(to, amount) {9 const from = msg.sender;10 const fromSlot = balanceSlot(from);11 const fromBalance = storage.read(fromSlot);12 if (fromBalance < amount) throw "insufficient balance";1314 storage.write(fromSlot, fromBalance - amount);15 const toSlot = balanceSlot(to);16 storage.write(toSlot, storage.read(toSlot) + amount);1718 emit("Transfer(address,address,uint256)", { from, to, amount }, "from", "to");19 return 1;20}
Try it liveLive on Base mainnet
01Connect wallet
Loading…
02Configure inputs
Connect wallet to continue
03Compile
Compile to continue
04Execute
Compile first

About

Sauce accepts TypeScript with EVM-native types and emits the same bytecode you would get from hand-written Solidity. The example here is the ERC-20 spec in 11 lines. Same selectors, same gas, same audit surface.

When to use this

  • Platforms launching first-party tokens from a TypeScript codebase
  • Agent-authored contracts where the TS corpus dominates
  • Teams that want Solidity-equivalent audit without writing Solidity