# @atpar/actus-solidity

> ACTUS smart contracts

Latest version **0.4.3** (published 2020-08-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atpar/actus-solidity
pnpm add @atpar/actus-solidity
yarn add @atpar/actus-solidity
bun add @atpar/actus-solidity
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2020-08-12 |
| First published | 2020-01-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | atpar AG |
| Maintainers | jo-es, jo-tud, nbundi |
| Keywords | Ethereum, Solidity, ACTUS |

## Links

- npm: https://www.npmjs.com/package/@atpar/actus-solidity
- Repository: https://github.com/atpar/ap-monorepo
- Homepage: https://github.com/atpar/ap-monorepo#readme
- Issues: https://github.com/atpar/ap-monorepo/issues
- npm.io page: https://npm.io/package/@atpar/actus-solidity

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.4.3 (latest) — 2020-08-12
- 0.4.2 — 2020-07-27
- 0.4.1 — 2020-07-24
- 0.4.0-beta.9 — 2020-07-08
- 0.4.0-beta.8 — 2020-07-02
- 0.4.0-beta.7 — 2020-07-01
- 0.4.0-beta.5 — 2020-06-26
- 0.4.0-beta.3 — 2020-06-25
- 0.4.0-beta.1 — 2020-06-19
- 0.3.0-beta.1 — 2020-06-18
- 0.3.0-beta.0 — 2020-05-01
- 0.2.1-beta.21 — 2020-04-23
- 0.2.1-beta.18 — 2020-04-06
- 0.2.1-beta.14 — 2020-03-09
- 0.2.1-beta.12 — 2020-02-27
- … 2 more at https://npm.io/package/@atpar/actus-solidity/versions

## README

# **ACTUS** Solidity

Solidity implementation of **ACTUS** Contract Types (https://www.actusfrf.org/algorithmic-standard)

## Smart Contracts

### Core
Contains banking-grade financial logic such as ACTUS day-count & end-of-month conventions, ACTUS datatypes and floating point arithmetic used throughout all ACTUS engines. 

### Engines
Contains ACTUS state machine engines for each ACTUS Contract Type. An Engine implements the state transition & payoff functions and the schedule generation logic for an ACTUS Contract Type. Engines are stateless smart contracts, thus can be used on-chain as well as off-chain (e.g. by using the EVM as a TEE).

### Basic workflow
1. Define an ACTUS term sheet depending on the financial contract you want to model and derive the `LifecycleTerms` object from that
2. Compute EventType-specific schedules via `computeNonCyclicScheduleSegment()` and `computeCyclicScheduleSegment()` (you may combine the schedules into one schedule for easier handling) as well as the initial state of the asset via `computeInitialState()` via the corresponding Engine contract
3. Evaluate each event in the schedule by computing its payoff via `computePayoffForEvent()` and the resulting state via `computeStateForEvent()` (note: the payoff has to be computed from the previous state - always compute payoff first then the  state)

## Development

### Requirements and Setup
See [README](https://github.com/atpar/ap-monorepo#development) in root directory.

### Testing
```sh
yarn test
```

## Implemented Conventions
- [x] Contract-Role-Sign-Convention (for PAM)
- [x] Contract-Default-Convention

### Business-Day-Count-Conventions
- [x] SCF (Shift/Calculate following)
- [x] SCMF (Shift/Calculate modified following)
- [x] CSF (Calculate/Shift following)
- [x] CSMF (Calculate/Shift modified following)
- [x] SCP (Shift/Calculate preceding)
- [x] SCMP (Shift/Calculate modified preceding)
- [x] CSP (Calculate/Shift preceding)
- [x] CSMP (Calculate/Shift modified preceding)

### Year-Fraction-Conventions (Day-Count-Methods)
- [x] A/AISDA (Actual Actual ISDA)
- [x] A/360 (Actual Three Sixty)
- [x] A/365 (Actual Three Sixty Five)
- [x] 30E/360ISDA (Thirty E Three Sixty ISDA)
- [x] 30E/360 (Thirty E Three Sixty)
- [ ] BUS/252 (Business Two Fifty Two)
- [ ] 1/1

### End-Of-Month-Conventions
- [x] Same Day Shift
- [x] End-Of-Month Shift

---
_Source: https://npm.io/package/@atpar/actus-solidity · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
