hyperweb-io / hyperweb-io/create-hyperweb-app
contract syntax
Open
- Dominant language
- TypeScript
- Stars
- 16
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
## state on the class itself
```ts
import { BigNumber } from "jsd-std";
export class Counter {
private count: BigNumber;
constructor(initialState: BigNumber) {
this.count = initialState;
}
public increment(amount: BigNumber): void {
this.count = this.count.add(amount);
}
public decrement(amount: BigNumber): void {
if (this.count.lt(amount)) {
throw new Error("Count cannot be negative");
}
this.count = this.count.sub(amount);
}
public getCount(): BigNumber {
return this.count;
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.