https://github.com/chase-manning/skittles
Write, Test and Deploy EVM Smart Contracts with TypeScript
https://github.com/chase-manning/skittles
compiler ethereum evm language smart-contracts typescript
Last synced: 4 months ago
JSON representation
Write, Test and Deploy EVM Smart Contracts with TypeScript
- Host: GitHub
- URL: https://github.com/chase-manning/skittles
- Owner: chase-manning
- License: mit
- Created: 2022-08-06T12:50:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2026-02-27T09:41:56.000Z (4 months ago)
- Last Synced: 2026-02-27T09:51:59.117Z (4 months ago)
- Topics: compiler, ethereum, evm, language, smart-contracts, typescript
- Language: TypeScript
- Homepage: https://skittles.dev/
- Size: 4.12 MB
- Stars: 38
- Watchers: 0
- Forks: 1
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Skittles
Write, Test and Deploy EVM Smart Contracts with TypeScript.
Skittles compiles TypeScript classes to Solidity source code, then to ABI and EVM bytecode. You get TypeScript tooling (autocomplete, type checking, familiar syntax) while targeting the EVM.
Website: [skittles.dev](https://skittles.dev/)
## Install
```bash
npm install skittles
```
Requires Node.js 20+.
## Quick Start
```bash
npx skittles init
npx skittles compile
```
This creates a `contracts/` directory with an example token contract and compiles it to `build/`.
## Example
```typescript
import { address, msg, SkittlesEvent, Indexed } from "skittles";
export class Token {
Transfer: SkittlesEvent<{
from: Indexed
;
to: Indexed;
value: number;
}>;
name: string = "My Token";
symbol: string = "TKN";
totalSupply: number = 0;
balances: Record
= {};
constructor(initialSupply: number) {
this.totalSupply = initialSupply;
this.balances[msg.sender] = initialSupply;
}
transfer(to: address, amount: number): boolean {
if (this.balances[msg.sender] < amount) {
throw new Error("Insufficient balance");
}
this.balances[msg.sender] -= amount;
this.balances[to] += amount;
this.Transfer.emit({ from: msg.sender, to, value: amount });
return true;
}
}
```
This compiles to a Solidity contract with events, mappings, a constructor, and a transfer function.
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).
## License
[MIT](./LICENSE)